Lab 14.1: HTTP Status Code - savannahc502/SavC-TechJournal-NET215 GitHub Wiki
Lab 14-1: HTTP Status Code
You can use telnet in a CLI to connect to a web server and retrieve pages.
- This is easily done on a linux system since telnet is built into the CLI
- On Windows, with admin privileges, you can enable the telnet client windows features
- Control Panel > Programs and Features > Turn Windows features on or off > Check the Telnet Client check box.
- Or, PutTY works too
- Tdefault is ssh, click the "other" button then telnet will be used.
Using Telnet in the CLI
- Have to manually type the
HTTP Message Request Start Line - The terminal may not print out what you're typing on screen, so be sure you enter the lines correctly!
- Use case:
telnet jasonoreeves.com 80>GET /test.html HTTP/1.1>Host:jasonoreeves.com
Creating a 400 Error:
Instead of doing a “GET request for /test.html HTTP/1.1”, I did a “GOT /test.html HTTP/1.1”. This resulted in the 400 Bad Request error since I was requesting a service from the sever that does not exist, so the server could not understand it.
Creating a 401 Error:
A 401 Error is when a user cannot access a page because they did not provide correct authentication. I used a browser and connect to http://dginter.net/login while running a WireShark Capture. Since I could not guess the username and password, the page returned an HTTP 401 error.
Creating a 403 Error:
A 403 error is when the client requesting the HTTP page deos not have permission to access the information. For this request, I typed “GET /forbidden.html HTTP/1.1” followed by Host:jasonoreeves.com.
WireShark Capturing 3XX Errors:
The one 3XX error code I found was a 301 Moved Permanetly error when I attempted to access http://www.burlingtoncityarts.org, which the response states in the “location” section is actually an https address now.