开发者

How do I delete something from a server using POST?

I'm new to J2ME. How do I delete something from a server using the POST method? Sample开发者_如何学编程s would be of great help.


Use DELETE method instead

I would recommend Apache HTTPClient. Example

URL url = new URL("http://www.example.com/resource");
HttpURLConnection httpCon = (HttpURLConnection) url.openConnection();
httpCon.setDoOutput(true);
httpCon.setRequestProperty(
    "Content-Type", "application/x-www-form-urlencoded" );
httpCon.setRequestMethod("DELETE");
httpCon.connect();
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜