java - Modify the POST header -
this question has answer here:
- sending http post request in java 8 answers
the xml-rpc server trying communicate requires each request contains following in first line of http header:
post /air http/1.1
however following code used,
urlc = (httpurlconnection)url.openconnection(); urlc.setconnecttimeout(180000); urlc.addrequestproperty("user-agent", "avaya/3.1/1.0"); urlc.addrequestproperty("authorization","basic qxzhewe6qxzhewe="); urlc.addrequestproperty("content-type", "text/xml"); urlc.setdooutput(true); urlc.setrequestmethod("post");
which results in....
post http/1.1 user-agent: avaya/3.1/1.0 authorization: basic qxzhewe6qxzhewe= content-type: text/xml
i.e. without "/air" bit.
please in modifying post header
make sure "/air" part included in url. it's not.
Comments
Post a Comment