Commons-httpclient-2.0 is easy to make in order when setParameter

xiaoxiao2021-03-06  86

Postmethod.SetParameter ("Localkburl", getLocalkburl ());

Postmethod.setRequestBody (bin);

Postmethod.AddRequestHeader ("Content-Type",

"Text / XML; Charset = ISO-8859-1");

SetParameter Before SetRequestBody, SETREQUESTBODY should be Clear Parameters.

Although it should be no problem in accordance with the order above, it is actually a conflict in SETPARAMETER and SetHeader, and can only join the parameters:

Postmethod.addRequestHeader ("Localkburl", getLocalkburl ());

Then, when you take the parameter:

String Localkburl = Request.getParameter ("Localkburl");

IF (localkburl == null || Localkburl.length () == 0)

Localkburl = Request.getHeader ("Localkburl");

转载请注明原文地址:https://www.9cbs.com/read-106309.html

New Post(0)