get vs post code example

Example 1: difference between GET, POST and REQUEST methods?

GET and POST are used to send information from client browser to web server.
GET the information is send via GET method in name/value pair and is URL encoded.
The default GET has a limit of 512 characters.
The POST method transfers the information via HTTP Headers. 
The POST method does not have any restriction in data size to be sent.
POST is used for sending data securely and ASCII and binary type's data.
The $_REQUEST contains the content of both $_GET, $_POST and $_COOKIE.

Example 2: post vs put

Post - 
      to create new object on the server

Put -
     to update object in server with new value

Example 3: PUT vs POST

"PUT" puts a file or resource at a particular URI and exactly at that
URI. If there is already a file or resource at that URI, PUT changes
that file or resource. If there is no resource or file there, PUT makes
one.

POST sends data to a particular URI and expects the resource at
that URI to deal with the request. The web server at this point
can decide what to do with the data in the context of specified
resource.

Tags:

Php Example