1 / 20

Requests and Server Response Codes

Requests and Server Response Codes. Part I - Requests. Two Main Request Types. GET POST Every file is requested by the client using one of these methods. Less Common Request Methods. HEAD Like GET, but only returns the header portion. Useful to verify the document exists.

georgecruz
Download Presentation

Requests and Server Response Codes

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Requests and Server Response Codes

  2. Part I - Requests

  3. Two Main Request Types • GET • POST • Every file is requested by the client using one of these methods.

  4. Less Common Request Methods HEAD Like GET, but only returns the header portion. Useful to verify the document exists. PUT Used to publish documents to the Web. DELETE Deletes the document

  5. Comparing GET and POST • GET appears in the URL (URI). • GET is limited in size. Don’t go over 1000 characters in your URI. • GET can refresh the same page, because the request includes the name value pairs • GET shows passwords in plain sight in the request.

  6. Comparing GET and POST • POST sends form information separately, so refreshing the page may be unsuccessful if the info was not cached. • POST can send more form information

  7. URL Encoding • Sometimes you will see strange symbols up in your URL. Those are URL Encoded symbols matching common characters such as a space or ampersand. That way the request won’t end up confusing the server or client. • My.cgi?example=Kevin%20Harville • For instance, your form input may include an ampersand, equals, or slash. These things have meanings that may cause errors unless interpreted correctly.

  8. Part II - Responses

  9. Overview • We are used to seeing 403 and 404 errors, indicating “forbidden” and “not found” respectively. • EVERY time the server is requested to serve a file it gives a response code. • The code is given in the response header.

  10. The Most Common Response • The most common response code is 200, meaning the client’s request was successful. • Your header may begin as follows: HTTP/1.1 200 OK Date: Monday, 12-March-01 17:45:91 GMT …..

  11. Response Code Summary • 100-199 Informational • 200-299 Request Successful • 300-399 Redirected. Further Action Necessary. • 400-499 Client Error • 500-599 Server Error

  12. Common 400 Errors • 400 Bad Request • 401 Unauthorized • 403 Forbidden • 404 Not Found • 405 Method Not Allowed • 408 Request Time-out

  13. 400 • There was a syntax error in the request

  14. 401 • The request lacked proper authorization.

  15. 403 • Forbidden • We commonly get this on Gaia when we forget to set our permissions.

  16. 404 • The infamous “Not Found” Error. • The file does not exist.

  17. 408 • The request timed-out due to client side error.

  18. 500 Errors • 500 Internal Server Error • This indicates that a part of the server (for example, a CGI or ASP program) has crashed or encountered a configuration error.

  19. Custom Error Pages • Perhaps you have seen custom error pages. To see one you may wish to type in a URL for a document that does not exist. • A major site will respond with a custom error page for 404 errors. • This page can be just like any other page. • You can configure Apache, IIS, or most other servers to serve custom error pages in response to specific errors.

More Related