what is \n \r in http get requests
843790Nov 9 2007 — edited Nov 9 2007hi,
last night i struggled a lot with a simple http get request.
apparently the webserver forced me to use http 1.1, which needed a hostname in the get request, which forced me to write two lines in my outputstream (while years ago a simple rq.write(GET /index.htm \n\n) was sufficient.
now it should be:
rq.write("GET /index.htm HTTP/1.1 \r\n");
rq.write("Host: aaa.eu:80 \n\n");
this above works, but i struggled a lot with it to make it work. i tried all possibilities to write it in one line, but nothing worked; the only way to make it work was let the first line end with \r\n and the second line with \n\n...
can someone explain me what the \r\n and the \n\n is???
and maybe someone can tell me why i could not write it in one line???
or tell me how you would have done it