Open GoogleCodeExporter opened 9 years ago
[deleted comment]
Here's a corrected version of myFunction from the example above.
public void myFunction()
{
final HttpRequest httpRequest = createRequestFactory().buildPostRequest(
new GenericUrl(requestUrl), null);
return httpRequest.execute().parseAs(ExpectedResponseData.class);
}
The same problems occur when I write it this way, with null content.data.
public void myFunction()
{
final UrlEncodedContent content = new UrlEncodedContent();
content.data = null;
final HttpRequest httpRequest = createRequestFactory().buildPostRequest(
new GenericUrl(requestUrl), content);
return httpRequest.execute().parseAs(ExpectedResponseData.class);
}
Original comment by tra...@circutus.com
on 16 Jun 2011 at 8:10
I'm having the same issue of zero length when trying to upload to youtube with
a multipart content, I really don't know how to solve it.
Original comment by maurru...@gmail.com
on 25 Jun 2011 at 4:00
I have this problem in the google tasks api when I "Move.execute()" a task.
Original comment by mwb...@gmail.com
on 1 Jul 2011 at 10:30
This appears to have been fixed in 1.5.0-beta (the original issue I posted on).
Original comment by tra...@circutus.com
on 1 Oct 2011 at 7:38
We had an internal investigation of this issue, and have not determined the
root cause yet. I'm keeping this open until we do. Here's a summary what we
[think we] know so far:
We don't know why, but we noticed this bug reproduces on the Sun JDK but not
OpenJDK. So if you are seeing this problem, our recommendation is that if you
are sending a POST with no content, you should use dummy data like a single
space (" "). Our service-specific libraries and MethodOverride do this
automatically by doing this:
if (request.content == null || request.content.getLength() == 0) {
request.content = new ByteArrayContent(" ");
}
Original comment by yan...@google.com
on 3 Oct 2011 at 11:54
Original issue reported on code.google.com by
tra...@circutus.com
on 16 Jun 2011 at 7:58