Sockets and Get of Http protocol
I have homework and I am completely lost. I am not fluent in java (or any other programming language). I am really struggling with these upper level java classes not knowing the basics of java. Long story on how that happened. Here is the assignment.
Write a program in Java that uses sockets to connect to a web server on port 80, requests a web page using GET of the HTTP protocol, and displays the resulting HTML
Ok i pretty much understand the socket thing, but i have been unable to find any info in the get of the http protocol. everything that shows up is relating to url connection, however, i don't think that is the assignment.
here is what i have for the socket so far which i got from a youtube tutorial so i don't have that great of a grasp on it.
Not looking for the assignment to be done for me. Just some help in the right direction please. and some links would be amazing.
Re: Sockets and Get of Http protocol
Quote:
info in the get of the http protocol
Get is probably the most commonly used HTTP statement. Google must have lots of pages that describe the HTTP protocol. Every time you enter a URL in the browser, it sends a GET to the site.
Here's a site that defines the HTTP protocol:
http://www.ietf.org/rfc/rfc2616.txt
Please edit your post and wrap your code with
[code=java]
<YOUR CODE HERE>
[/code]
to get highlighting and preserve formatting.
Re: Sockets and Get of Http protocol
I have found information on the get, but most of it is the urlconnection stuff. is the GET of the HTTP protocol a part of the urlconnection or am i looking for something different since i need to use a socket to connect. it just seems pointless to use a socket if i am using the urlconnection. Im sorry I know so little about this im not even sure how to word my questions.
Re: Sockets and Get of Http protocol
The HTTP protocol has nothing to do with a Java class. It defines how client-server communications are to be done.
The protocol can be used by any language. There are java classes that use the http protocol.
Re: Sockets and Get of Http protocol
Ok i feel a little silly now that i get the question. I was thinking it was a class. Thank you for taking the time.
Re: Sockets and Get of Http protocol
Ok. Come on back if you have problems down the line.