Presentation is loading. Please wait.

Presentation is loading. Please wait.

Requests and Server Response Codes

Similar presentations


Presentation on theme: "Requests and Server Response Codes"— 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/ OK Date: Monday, 12-March-01 17:45:91 GMT …..

11 Response Code Summary 100-199 Informational 200-299 Request Successful
Redirected. Further Action Necessary. Client Error 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.

20


Download ppt "Requests and Server Response Codes"

Similar presentations


Ads by Google