Search This Site

Custom Search

Friday, December 10, 2010

[bloggerDev] HTTPRequest in Java - unexpected end of line

Hi everyone,

I'm new to the group here, so sorry if this question has been asked
before - can't seem to find it anywhere online.

Using the class HTTPURLConnection I am able to authenticate with the
Blogger service and successfully obtain an authentication key -
however when I send a further request to insert a blog post, my
application times out and eventually I get the following exception:

java.net.SocketException: Unexpected end of file from server
at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)
at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)
at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown
Source)
at HTTPOperations.httpPOST(HTTPOperations.java:60)
at TestClass.main(TestClass.java:56)

However, when I manually send a request using cURL, it adds the new
blog post completely fine! So I guess my question is, what is the
Blogger service sending back, that HTTPURLConnection.getInputStream()
is failing on?

Cheers,

Tim.

--
You received this message because you are subscribed to the Google Groups "Blogger Developer Group" group.
To post to this group, send email to bloggerdev@googlegroups.com.
To unsubscribe from this group, send email to bloggerdev+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/bloggerdev?hl=en.

No comments:

Post a Comment