Hello guys, i'm having this project where i must create a server that communicates with a browser.I must write something like this in the browser: http://localhost:11880/path
and the message printed in the server will be:
GET /path HTTP/1.1 Host: localhost:11880 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:126.96.36.199) Gecko/20101027 Ubuntu/10.04 (lucid) Firefox/3.6.12 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 115 Connection: keep-alive Referer: http://localhost:11880/path
Firstly i haven't understand what 'get' will do. The printed message will be different for get and post method, but i cant understand if i will have to write: 'get http://localhost:11880/path' in the browser or just 'http://localhost:11880/path' and get will be printed to server through the request. Additionaly i have to send back to the browser a RFC response, but there are so many cases and i don't know in which case to print each message(404: not found, 501 Not implemented etc) and how to print it. Every help would be appreciated, i am desperate, i have stuck at this point for about a day.