Jump to content
  • Advertisement
Sign in to follow this  
ArchG

Detecting 404 errors, redirects, and other errors with Winsock

This topic is 4833 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello again everyone! I'm trying to do exactly what the title says. Kindof like making a link verifyier..that will scan text files (html, asp, or other webpage docs) pick up links and test them and get the results..like if it's redirected somewhere..grab where it's being redirected and give me the option to change it..and stuff like that If anyone can point in the right direction, that would be awesome Oh, and also, if you're gunna just direct me to [google], give me some search strings! I can't find anything to do with this topic no matter what I search for. Thanks P.S I'd like to use C++ on this project, but if you know of a library in another language that works great for this sorta thing (better than a c++ lib) don't be hesitant to shout it out.

Share this post


Link to post
Share on other sites
Advertisement
You basically have to implement part of the HTTP protocol. Connect, transfer a request ("get whatever"), see what you recieve, check it for 404s (it should have the number 404 in it), redirects (whatever the HTTP code is for it) and meta-redirects (scan the HTML file and look for meta tags).

Google for stuff on HTTP.

For a pre-built solution this may be useful.

Share this post


Link to post
Share on other sites
The error code is in the very first line the server sends to you after you've sent it your request.

HTTP/<version> <error number> <reason>

Example:

HTTP/1.1 200 OK or HTTP/1.1 404 Not Found

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!