Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

about "post" URL request  RSS feed

 
albert huang
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,
I am thinking of some interesting questions.
first, I make a small web application to send a url requst to some urls.
and get back the response like the following.
URL myURL = new URL( getURLString(strURL) )
URLConnection myURLConnection = myURL.openConnection();
myInStream = myURLConnection.getInputStream();
... ...
and it works only for the GET method URL,

My question is how can I receive the response from some urls that only receive POST method request, I have no idea at all,
Anyone have any thoughts? thanks a lot.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If that URL starts with "http://" what you actually get from openConnection is a HttpURLConnection. Look that up in the JavaDocs to see that there is a method by which you can set the request method to "POST"
Bill
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!