amitbatajoo / opensocial-java-client

Automatically exported from code.google.com/p/opensocial-java-client
Apache License 2.0
0 stars 0 forks source link

http error 411 #38

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.request = PeopleService.getViewer();
2.response = client.send(request);
3.Map<String, Response> responses = send(requests);
4.responses = submitRpc(requests);
Here, I make a java.util.HashMap<String, String> requestHeaders and put this 
header:

requestHeaders.put(HttpMessage.CONTENT_TYPE, provider.getContentType());

after this I do:

HttpMessage message = authScheme.getHttpMessage(provider, "POST",
        buildRpcUrl(), requestHeaders, buildRpcPayload(requests));

but when I do

HttpResponseMessage responseMessage = httpClient.execute(message);

the error 411 is returned, this error is because the server doesn't know the 
length of the message. I tried to do

requestHeaders.put(HttpMessage.CONTENT_LENGTH,, Integer.toString(36));

but the same error is still returned.

What I could do?

Original issue reported on code.google.com by ricardop...@gmail.com on 7 Dec 2011 at 5:51