I have a project for university and I need to write a c program that checks some website from time to time. So I need to resolve the address and then connect at the ip that I get when resolving the website address with gethostbyname. The only problem that I have is that I need to check for redirect. But each time I request a header I always get a 302 found answer and a Location field in the header even after I follow the redirect. I never get a 200 answer or one of the other 2xx answers. Any ideas why I get this answer?
Question
Cold Blood
I have a project for university and I need to write a c program that checks some website from time to time. So I need to resolve the address and then connect at the ip that I get when resolving the website address with gethostbyname. The only problem that I have is that I need to check for redirect. But each time I request a header I always get a 302 found answer and a Location field in the header even after I follow the redirect. I never get a 200 answer or one of the other 2xx answers. Any ideas why I get this answer?
Link to comment
Share on other sites
4 answers to this question
Recommended Posts