I'm still new to screwing with http requests in java but maybe I can help you a little. (or confuse you :P)
This might be difficult to grasp if you don't already understand http requests and what they are made of. You will need some way of viewing the http requests that are being sent before you can send one in java. Download Fiddler, or some tool, or use a network analyzer in your browser. Google Chrome has one built in if you look at the Network tab of inspect element. I use an add-on for Firefox called HttpFox. I like the way it's organized. :P
I don't know how much you understand about http at the moment so here are some posts from @
atheus that may help you understand. (or confuse you
)
HTTP Requests and
GET and POST
The best way to learn is probably just to screw around with it yourself. Look at http requests with Google Chrome(inspect element -> network) and try to understand how they are structured and what everything means. Once you think you understand HTTP requests you might be able to start using java to send these yourself.
Here's a simple example on how you would send an http request in java and catch a response:
This is a very simple example and doesn't involve sending any http headers along with it.
It might be annoying since you probably don't understand what a URLConnection object is or a BufferedReader but you just need to screw around with it and this will become very easy for you.
I hope I didn't confuse you haha :P
Bookmarks