[转]GET and POST methods/HTTP status codes

http://www.softwaretestingtimes.com/2010/04/web-testing-basic-concepts-getpost.html

 

GET and POST methods

 
GET
–Requests a representation of the specified resource. Note that GET should not be used for operations that cause side-effects, such as using it for taking actions in web applications. One reason for this is that GET may be used arbitrarily by robots or crawlers, which should not need to consider the side effects that a request should cause. 

POST
–Submits data to be processed (e.g., from an HTML form) to the identified resource. The data is included in the body of the request. This may result in the creation of a new resource or the updates of existing resources or both.
Example

image



image 


HTTP status codes-1
1xx Class, Informational. Means Request received, continuing process.
This class of status code indicates a provisional response, used in experimental conditions only.
100 Continue
–This means that the server has received the request headers, and that the client should proceed to send the request body
101 Switching Protocols
102 Processing
122 Request-URI too long

HTTP status codes-2
2xx Class Success
The action was successfully received, understood, and accepted.
This class of status code indicates that the client's request was successfully received, understood, and accepted.
- 200 OK
- Standard response for successful HTTP requests.
202 Accepted
- The request has been accepted for processing, but the processing has not been completed. The request might or might not eventually be acted upon, as it might be disallowed when processing actually takes place.
- 203 Non-Authoritative Information (since HTTP/1.1)
- 204 No Content


HTTP status codes-3
- 3xx Redirection
- The client must take additional action to complete the request.
- This class of status code indicates that further action needs to be taken by the user agent in order to fulfill the request.

- 301 Moved Permanently
–This and all future requests should be directed to the given URI.

- 302 Found
–This is the most popular redirect code, but also an example of industrial practice contradicting the standard. HTTP/1.0 specification (RFC 1945) required the client to perform a temporary redirect (the original describing phrase was "Moved Temporarily"), but popular browsers implemented it as a 303 See Other. Therefore, HTTP/1.1 added status codes 303 and 307 to disambiguate between the two behaviors. However, the majority of Web applications and frameworks still use the 302 status code as if it were the 303.

- 305 Use Proxy (since HTTP/1.1)
–Many HTTP clients (such as Mozilla and Internet Explorer) don't correctly handle responses with this status code, primarily for security reasons.

- 307 Temporary Redirect (since HTTP/1.1)
–In this occasion, the request should be repeated with another URI, but future requests can still use the original URI. In contrast to 303, the request method should not be changed when reissuing the original request. For instance, a POST request must be repeated using another POST request.


HTTP status codes-4
4xx Class Client Error
The 4xx class of status code is intended for cases in which the client seems to have erred. These are typically the most common error codes encountered while online.

400 Bad Request
–The request contains bad syntax or cannot be fulfilled.

401 Unauthorized
–Similar to 403 Forbidden, but specifically for use when authentication is possible but has failed or not yet been provided.

403 Forbidden
–The request was a legal request, but the server is refusing to respond to it. Unlike a 401 Unauthorized response, authenticating will make no difference.

404 Not Found
–The requested resource could not be found but may be available again in the future. Subsequent requests by the client are permissible.

posted @ 2012-03-19 11:54  Jessica's World  阅读(360)  评论(0编辑  收藏  举报