It looks like there's a bug in the 1.4.3 development server regarding
to POST requests. It worked for me again when I removed the Content-
Length header parameter.

On Apr 4, 3:51 pm, Peter <[email protected]> wrote:
> Hi
>
> I have an application running on gae and another client application
> running on a local development server.
> The client application is trying to send some params through a http
> connection an recive some respone in the same connectin.
> The client application works fine but after i change the SDK versin
> 1.4.2 or higher I get an exception:
> java.io.IOException: Could not fetch 
> URL:http://myserverapplication.appspot.com/something
> at
> com.google.appengine.api.urlfetch.URLFetchServiceImpl.convertApplicationExc 
> eption(URLFetchServiceImpl.java:
> 110) ......
> I got an exception when calling connection.getResponseCode();
>
> Can somebody help me?
>
> Here is my code:
>
> URL url = new URL("http://myserverapplication.appspot.com/something";);
> HttpURLConnection con;
> int responseCode = HttpURLConnection.HTTP_UNAVAILABLE;
> con = (HttpURLConnection) url.openConnection();
> con.setRequestMethod("POST");
> con.setRequestProperty("Content-Type", "application/x-www-form-
> urlencoded");
> con.setRequestProperty("Content-Length", "" +
> Integer.toString(urlParameters.getBytes().length));
> con.setRequestProperty("Content-Language", "en-US");
> con.setUseCaches(false);
> con.setDoInput(true);
> con.setDoOutput(true);
> DataOutputStream wr = new DataOutputStream(con.getOutputStream());
> wr.writeBytes(urlParameters);
> wr.flush();
> wr.close();
> responseCode = con.getResponseCode();

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to