curl-header tagged requests and articles

Categorized request examples and articles tagged with [curl-header] keyword
Curl Request With Bearer Token Authorization Header
An example of a Curl request with Bearer Token Authorization header. The bearer token is sent to the server in the 'Authorization: Bearer {token}' authorization header. The 'Accept: application/json' header tells the server that the client expects a JSON. The server informs the client that it returned a JSON with 'Content-Type: application/json' response header.

Curl Command With Close Connection Header
This example shows how to send a Curl request to the server and indicate that the client does not want to keep the connection open by sending the Connection: close header. The header is passed with the curl -H command-line option.

Curl Custom Headers
An example of posting a custom header with Curl. To add a custom header to curl, you need to pass the -H "header: value" command line parameter to the curl request. The target url is passed as the first parameter.

Curl Command With Keep-Alive Connection Header
An example of a Curl request with connection and keep-alive headers. The Connection header is passed with the -H "Connection: keep-alive" command-line parameter. The Keep-Alive header is passed with the -H "Keep-Alive: timeout=5, max=100" command-line parameter.

Curl Add Header
An example of adding a header to the Curl request. Use the -H command-line option to set the Curl header details. In this Curl Add Header example, the -H "Content-Type: application/json" command-line option indicates the media type of the resource, and the Accept: application/json header tells the server that the client expects JSON.