On Mon, Aug 5, 2013 at 5:28 PM, Cosmia Luna <[email protected]> wrote: > Most browsers and HTTP clients send HTTP requests like: > > GET /path/to/resource HTTP/1.1 > Host www.example.com > > But, some clients send HTTP requests like: > > GET http://www.example.com/path/to/resource HTTP/1.1 > Host www.example.com > > Why?
According to the RFC, yes, it's accepted: http://tools.ietf.org/html/rfc2616#section-5.1.2 > And, how can I send a HTTP request manually? > Say I have a string > ("GET http://www.example.com/path/to/resource HTTP/1.1\r\n" > "Host www.example.com\r\n") > > , how can I issue a HTTP request EXACTLY same with it? > You can do this using telnet: $ telnet 127.0.0.1 80 GET http://www.example.com/path/to/resource HTTP/1.1 Host: www.example.com Or netcat: $ nc 127.0.0.1 80 GET http://www.example.com/path/to/resource HTTP/1.1 Host: www.example.com Hit enter twice after entering the last line. -Steve -- You received this message because you are subscribed to the Google Groups "pocoo-libs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/pocoo-libs. For more options, visit https://groups.google.com/groups/opt_out.
