0

I am calling webservice and constantly getting Missing payload for POST error.. I dont know what is wrong with the code.. I have Called authentication webservice and receiving Accesskey.. And passing that accesskey to the other webservice from where i need list of players.. this is the code for my request :

// defaultHttpClient
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpPost httpPost = new HttpPost(url);
HttpResponse httpResponse = httpClient.execute(httpPost);
HttpEntity httpEntity = httpResponse.getEntity();
xml = EntityUtils.toString(httpEntity);

Please suggest me where i am wrong...??? Also "Missing payload for POST" error is what exactly???

Kruti Mevada
  • 517
  • 5
  • 7
  • 21

2 Answers2

0

use this

            HttpClient client = new DefaultHttpClient();  
            String postURL = Constant.REGISTRATION_URL;
            HttpPost post = new HttpPost(postURL); 
    MultipartEntity reqEntity = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE);

make sure that u r using correct or valid URL

Nikhil Lamba
  • 593
  • 1
  • 6
  • 17
  • Nop i have checked everything i have passed is fine.. can you explain me wht exactly "Missing payload for POST" error means??? – Kruti Mevada May 10 '12 at 13:03
0

HTTP POST is one of the request methods of the HyperText Transfer Protocol as defined by RFC2616.

You may refer to the HttpPost class.

To answer your question, you need to understand that unlike HTTP GET, HTTP POST requires that the request contain a body or Payload that is submitted to the server. Take a look at How to Execute HTTP POST Requests in Android for code snippet.

Rajesh
  • 15,724
  • 7
  • 46
  • 95