Navkirat Singh wrote:
Aaah figured it out...!!
It was elementary, I was lacking the carriage return and line feed
characters at the end of the status and header line. Here is how I
solved it:
hostsock.send(b'HTTP/1.1 301 Moved Permanently\r\nLocation:
http://www.example.com\r\n')
Aaah figured it out...!!
It was elementary, I was lacking the carriage return and line feed
characters at the end of the status and header line. Here is how I
solved it:
hostsock.send(b'HTTP/1.1 301 Moved Permanently\r\nLocation: http://www.example.com\r\n'
)
Regards,
Nav
On 23-Jul-20
Hi Guys,
I am very new to python and I am trying to send HTTP headers for
redirection using sockets in python 3, but in vain. If I use the meta
tag REFRESH method the redirection works. Please advise what I am
missing, below is the snippet of my code:
hostsock is the socket object
print