301 redirection to the same url

Hi there!

I am sending http requests using this code :

https://gist.github.com/nolim1t/126991

It works well for most of the http websites, but when I try to get this url "http://www.cplusplus.com/" the webserver performs a 301 redirection to the same url.

Isn't the webserver supposed to provide a new url in the 301 http headers? What am I doing wrong?

Thanks a lot!!

Last edited on
Hi everyone!

I found the solution, the get request should be like this :

"GET / HTTP/1.0\r\nHost: www.cplusplus.com\r\n\r\n\r\n"

All the best!
Topic archived. No new replies allowed.