Re: [appengine-java] Re: URL Fetch java.io.IOException
Can help you , http://ikaisays.com/2010/06/29/using-asynchronous-urlfetch-on-java-app-engine/ .. 2011/4/9 Z > I think that it might apply to ALL types of the HTTP requests (i.e GET > and POST). > > On Apr 4, 10:20 am, Thomas Visser wrote: > > 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 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 > google-appengine-java@googlegroups.com. > To unsubscribe from this group, send email to > google-appengine-java+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/google-appengine-java?hl=en. > > -- *Felipe Teixeira* *Desenvolvedor Java * IPNET - Soluções em Informática Tel.: 55 21 3553 2717 / 21-7805-6867 Rua Visconde de Inhaúma, 134, Sala 615 Centro - RJ - CEP: 20091-007 *http://www.ipnetsolucoes.com.br * -- 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 google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Re: URL Fetch java.io.IOException
Ok, never mind. I removed the con.setRequestProperty("Content- Length",...) in the offending code and that solved my problem. Thanks! Stefan -- 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 google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Re: URL Fetch java.io.IOException
Hi Thomad and Z, could one of you describe what you did? Do you simply mean that you remove this line: con.setRequestProperty("Content-Length", "" + Integer.toString(urlParameters.getBytes().length)); For what it's worth: I think this is related to issue 4823 (though the title seems to suggest it is only concerned with https): http://code.google.com/p/googleappengine/issues/detail?id=4823 Best regards, Stefan -- 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 google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Re: URL Fetch java.io.IOException
I think that it might apply to ALL types of the HTTP requests (i.e GET and POST). On Apr 4, 10:20 am, Thomas Visser wrote: > 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 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 google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Re: URL Fetch java.io.IOException
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 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 google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.