-2

I want to send post request programaticaly, using URL and inputStream so I can read output. I dont know at all how to start, I tried two other topics form SO but none worked... I dont want to use Apache client.

Thanx for replies.

noisy cat
  • 2,563
  • 4
  • 28
  • 50
  • *Why* don't you want to use HttpClient, what *exactly* have you tried, and what happened. It's very hard to answer such a vague question. – Jon Skeet Mar 18 '12 at 18:26
  • I dont want to use becouse I dont want to be dependent on their software, I tried http://stackoverflow.com/questions/3324717/sending-http-post-request-in-java and one more SO topic that I cant find now. – noisy cat Mar 18 '12 at 18:31
  • What you actually looking for ? Post request with URL? – Arung Mar 18 '12 at 18:36
  • See this thread in SO [How to use http url connection](http://stackoverflow.com/questions/2793150/how-to-use-java-net-urlconnection-to-fire-and-handle-http-requests) Study it (BalusC answer is **really** awsome!) and you should be ok. – Cratylus Mar 18 '12 at 18:32

1 Answers1

1

Try the HttpURLConnection class

heres a link to the javadoc http://docs.oracle.com/javase/1.4.2/docs/api/java/net/HttpURLConnection.html#method

heres an example i found http://www.xyzws.com/Javafaq/how-to-use-httpurlconnection-post-data-to-web-server/139

Hope it works

Patuck
  • 171
  • 1
  • 6