request-example tagged requests and articles

Categorized request examples and articles tagged with [request-example] keyword
GET Request Example
An example of sending an HTTP GET request to the server to get a resource at the specified URL. In this GET request example, the Accept: */* request header tells the server that the client accepts all types of media. The Content-Type: text/html response header informs the client that the server has returned HTML for this GET request.

POST HTML Form Example
An example of submitting HTML form data in a URL-encoded format. The Content-Type: application/x-www-form-urlencoded header indicates the media type of the resource. The x-www-form-urlencoded encoding is used when submitting an HTML form and means that the data is represented by name/value pairs separated by ampersands (&), and names are separated from values ​​by equality (=).

POST Request Example
An example of making an HTTP POST request to the server. In this POST request example, the Content-Type request header indicates the media type of the POST body, and the Content-Length request header indicates the size of the data in the POST request body.

PUT Request Example
An example of sending an HTTP PUT request to the server. In this PUT request example, the Content-Type request header indicates the media type of the PUT request body, and the Content-Length request header indicates the size of the data in the PUT message.

HEAD Request Example
An example of making an HTTP HEAD request to the HTTP API endpoint. In this HEAD request example, the Content-Type response header indicates the media type of the server response, and the Content-Length response header indicates the size of the data on the server.

Curl POST Request
An example of making a POST request using Curl. The -X POST command line parameter tells Curl to use the POST method for this request. The -d command line parameter contains the data to send to the server. The Curl -H "Content-Type: application/json" command line parameter specifies the media type of the resource in the request body.

Curl GET Request
An example of making a GET request using Curl. Curl automatically selects the GET method unless the -X, --request, or -d command-line options are passed. The target URL is passed as the first command-line parameter. The second command-line parameter tells the server that the Curl client is expecting JSON.

HTTP POST Example
An HTTP POST request example that shows how to send data to the HTTP API endpoint. In this POST request example, the Content-Type: application/json request header indicates the type of media resource in the POST request body. The Content-Length: 80 indicates the size of data in the HTTP POST message.

HTTP POST
The HTTP POST method is used to send data to the server. The type and size of data are not limited but you must specify the data type in the Content-Type header and the data size in the Content-Length header fields. The HTTP POST method is not idempotent, which means that sending an identical POST request multiple times may additionally affect the state or cause further side effects.

HTTP GET
The HTTP GET method is used to request a resource from the server. The GET requests cannot have a message body but you still can send data to the server using the URL parameters. HTTP GET requests should only receive data (the server must not change its state). If you want to change data on the server, use POST, PUT, PATCH or DELETE methods.

HTTP HEAD Request
The HTTP HEAD method is used to retrieve HTTP headers from the server. The server does not return the message body in the response.