开发者

Why is HttpPost using a GET method? [Android]

I am executing the following post in Android:

HttpClient httpclient = new DefaultHttpClient();  
HttpPost httppost = new HttpPost("http://www.example.com");  
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();  
nameValuePairs.add(new BasicNameValuePair("account", "login"));  
nameValuePairs.add(new BasicNameValuePair("email", "email@email.com));  
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));  
HttpResponse response = httpclient.execute(httppost);

In the server side I return开发者_Go百科 the cgi.request_method variable and it is GET.

Shouldn't it be POST? Am I missing something?


That code should initiate a POST, not a GET. I would guess that something on the server side is misconfigured.


My problem was send http instead of https

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜