开发者

cURL XML REST POST in Java Android

How can I convert this statement in cURL curl -i -X POST -H开发者_C百科 "Content-Type:application/xml" -H "Accept: application/xml" -d "<ticket><summary>This is a Summary</summary><priority>3</priority></ticket>" http://user:password@www.assembla.com/spaces/my_space_id/tickets to Java in Android? The most important part is how to invoke the XML in the URL?


Use HttpClient, specifically HttpPost for your POST request. The -H switches turn into addHeader() calls. You would probably just use a StringEntity for the XML payload, though I haven't tried a non-urlencoded POST with HttpClient before.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜