request-header tagged requests and articles

Categorized request examples and articles tagged with [request-header] keyword
POST JSON String
An example of posting a JSON string to the REST API endpoint. The Content-Type: application/json request header indicates the media type of the resource in the request body. The Accept: application/json request header tells the server that the client expects JSON. The Content-Type: application/json response header indicates that the server returned JSON.
json post-request post-data request-header post-json rest-api

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 get-request bearer-token authorization authorization-header request-header

GET JSON String
An example of how to request a JSON string from the server. The 'Accept: application/json' request header tells the server that the client expects a JSON. The 'Content-Type: application/json' response header informs that the server returned a JSON string.
json get-request request-header rest-api get-json

Curl POST JSON Example
An example of a Curl command to post a JSON string to the REST API endpoint. The 'Content-Type: application/json' request header indicates the media type of the resource in the request body. The 'Accept: application/json' request header tells the server that the client expects a JSON media type. The JSON is passed in the -d command-line parameter.
curl json post-json post-request rest-api request-header

GET Request With Bearer Token Authorization Header
An example of sending a GET request with Bearer Token authorization header. The bearer token is sent to the server in the 'Authorization: Bearer {token}' request 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.
get-request bearer-token authorization authorization-header request-header form

Curl Command to GET a JSON String
An example of a Curl command to get a JSON string from the REST API endpoint. The 'Accept: application/json' request header is passed to the server with the Curl -H command-line parameter and tells the server that the client expects JSON media type.
curl json get-json get-request rest-api request-header

POST XML String
This page shows how to post an XML string to the target URL. The 'Content-Type: application/xml' request header indicates the media type of the resource in the request body. The 'Accept: application/xml' request header tells the server that the client expects an XML media type.
xml post-request content-type soap-api post-xml request-header

GET XML String
An example of how to request an XML string from the server. The 'Accept: application/xml' request header tells the server that the client expects an XML. The 'Content-Type: application/xml' response header informs the client that the server returned an XML string.
get-xml xml get-request soap-api request-header

Curl Command to POST an XML String
An example of a Curl command to post an XML string to the API endpoint. The 'Content-Type: application/xml' request header indicates that the request body contains an XML. The 'Accept: application/xml' request header tells the server that the client expects an XML. The XML is passed in the Curl -d command-line parameter.
curl post-request post-xml xml soap-api request-header

Curl Command to GET an XML String
An example of a Curl command to get and an XML string from the API endpoint. The 'Accept: application/xml' request header tells the server that the client expects an XML. The 'Content-Type: application/xml' response header informs the client that the server returned an XML string.
curl xml get-request get-xml soap-api request-header

Send Custom Headers with Curl
This page shows how to send a Curl command with custom request headers.
curl get-request custom-header request-header

Curl Command With Keep-Alive Connection Header
An example of a Curl request sent to the server to establish a persistent connection with the Connection and Keep-Alive headers. Try it with ReqBin Curl online.
curl connection-header head-request keep-alive request-header

GET Request Like Google Chrome
This page demonstrates how to send a GET request with a custom User-Agent header that emulates a request from Google Chrome.
get-request custom-header user-agent http-header google-chrome request-header get-method browser

GET Request With Custom Headers
This page shows how to send a GET request with custom request headers.
get-request custom-header request-header get-method

Curl Command with CORS Headers
This page shows how to send a Curl request with CORS Origin header (Cross-Origin Resource Sharing request).
curl cors get-request request-header get-method

Send Custom Headers With GET Request
This page shows how to send a GET request with custom HTTP headers to the API endpoint. Try it yourself with ReqBin online HTTP Client.
http-headers http-request get-request custom-header request-header get-method

Keep-Alive Connection Example
This page shows how to establish a persistent connection with the server using the Connection and Keep-Alive headers. Try it with the ReqBin online HTTP client.
keep-alive connection-header request-header

GET Request Like Mozilla Firefox
This page demonstrates how to send a GET request with a custom User-Agent header that emulates a request from Mozilla Firefox.
get-request custom-header user-agent mozilla-firefox request-header browser

GET Request with CORS Headers
This page demonstrates how to send a CORS request with the Origin header (Cross-Origin Resource Sharing request).
get-request cors origin-header get-method request-header

GET Request with Cookies in Header
This page shows how to send a GET request with HTTP cookies in the request header.
get-request cookies request-header get-method

Close Connection Example
This page shows how to tell the server that the client doesn't want to keep the connection open by sending 'Connection: close' header.
connection-close http-headers connection-header get-request get-method request-header

GET Request Without Accept-Encoding Header
If you do not specify Accept-Encoding in the request headers or the server does not support compression, the response body will not be compressed.
get-request accept-encoding request-header get-method

GET Request With Accept-Encoding Header
This page shows how to send a GET request with an Accept-Encoding: gzip header, which tells the server to send gzip-encoded content.
get-request accept-encoding gzip-encoded request-header get-method rest-api

Curl Command with HTTP Headers to Prevent Caching
An example of Curl command with HTTP headers to prevent caching that works across all servers and proxies.
curl caching prevent-caching request-header get-request get-method

HTTP Headers to Prevent Caching
The correct minimum set of HTTP headers to prevent caching that works across all servers and proxies.
http-headers prevent-caching proxy request-header get-request get-method caching

Curl Command with Cookies in Header
This page shows how to send a Curl request with HTTP cookies in the request header.
curl cookies get-request request-header get-method

Curl Command to POST JSON String with Bearer Token Authorization Header
This page shows how to send a JSON string with a Bearer token authorization header with Curl.
curl json post-request bearer-token authorization authorization-header post-json request-header

GET Request With Bearer Token Authorization Header
This page demonstrates how to send a GET request to an HTTP API endpoint with Accept: application/json and Bearer token authorization headers.
get-request json bearer-token authorization-header accept-header rest-api request-header authorization

POST JSON String with Custom Headers
This page shows how to post JSON with custom request headers.
post-request json request-header custom-header post-json rest-api post-method submit-data post-data

GET Request with Cookies in header to get JSON
This page shows how to send a GET request with HTTP cookies in the header to get JSON. Try it yourself with ReqBin online HTTP Client.
get-request cookies json http-headers get-method rest-api request-header

POST JSON with Curl
An example of a Curl request to post a JSON string to the REST API endpoint. The 'Content-Type: application/json' request header indicates the media type of the resource in the request body. The 'Accept: application/json' request header tells the server that the client expects a JSON. The JSON string is passed in the Curl -d command-line parameter.
curl json post-request request-header rest-api post-json

Curl GET JSON Example
This page shows how to send a Curl command to get JSON from the server.
curl json get-request get-json rest-api get-method request-header

Curl Command to POST JSON String With Basic Authentication
This page shows how to send a JSON string with Basic authentication header with Curl.
curl json basic-authentication authentication-header request-header authorization rest-api

Curl REST API GET Example
An example of a Curl command for sending a GET request to the REST API endpoint to get a JSON. Try it yourself with ReqBin online Curl Client.
curl json get-request request-header rest-api

Curl POST Form
An example of POST-ing a form with Curl with 'Content-Type: application/x-www-form-urlencoded' HTTP header. Try it yourself with ReqBin online Curl client.
curl post-form post-request urlencoded request-header post-method

curl -d
A live example of the Curl command for sending data in POST request with the correct HTTP header. Try it yourself with ReqBin online Curl client.
curl post-form post-request request-header urlencoded curl-command post-method submit-data http-header

Posting JSON to the Server with Curl
Curl command for posting JSON data to the server as a part of the request. The 'Content-Type: application/json' header indicates that we are sending a JSON. The 'Accept: application/json' header tells the server that we can accept JSON.
curl json post-request request-header rest-api post-json

Client Request with Content-Type Header
An example of an HTTP request to send a JSON string to the server. The 'Content-Type: application/json' header tells the server that the request body contains a JSON string.
post-request json content-type post-method rest-api request-header

GET Request with Cookie Header
This page shows how to send a GET request with the HTTP Cookie header. Try it yourself with the ReqBin online HTTP client.
get-request http-headers cookies get-method request-header

POST Request With Content-Length Header
This page shows how to send a POST request with a Content-Length header that indicates the size of the provided JSON.
post-request content-length json post-method rest-api request-header post-data

POST Request
An example of sending a POST request with JSON data to the REST API endpoint. Try it yourself with ReqBin online HTTP Client.
post-request rest-api json post-json request-header

OPTIONS Request by Curl
An Example of Sending OPTIONS Request with Curl
curl options-request origin-header request-header http-headers options-method

POST JSON with Curl Example
This page shows how to send a Curl command with JSON string
curl json post-request request-header post-json rest-api

Curl with Authorization Header Example
This page shows how to send a Curl request with Bearer Token authorization header.
curl authorization-header request-header bearer-token

curl -u
A live example of sending Curl command with Basic server authentication header (credentials are provided with -u or --user command-line argument). Try it yourself with ReqBin online Curl client.
basic-authentication http-header curl json authorization request-header curl-command

POST JSON with Custom Authorization Header
This page shows how to post JSON string with a custom authorization header. Try it yourself with ReqBin online HTTP Client.
post-request json custom-header authorization-header authorization rest-api request-header post-json custom-authorization

GET Request With CORS Header
An example of sending a GET request with the CORS headers. Try it yourself with the ReqBin online HTTP client.
get-request cors get-method request-header origin-header

Curl POST Request
An example of making a POST request with Curl. The '-H "Content-Type: application/json"' Curl command-line parameter indicates the media type of the resource. The '-d "{...}"' command-line parameter contains the data to send to the server. The 'Accept: application/json' request header informs the server that Curl client expects a JSON.
curl json post-data post-request request-header

OPTIONS Request
An Example of Sending OPTIONS Request.
options-request request-header origin-header

Curl GET Request
An example of making a GET request with Curl. The '-H "Accept: application/json"' Curl command-line parameter appends 'Accept: application/json' request header and informs the server that Curl client expects a JSON. The 'Content-Type: application/json' response header informs the Curl client that the server returned a JSON string.
curl get-request request-header

REST API GET Example
An example of sending a GET request to the REST API endpoint to get a JSON. Try it yourself with ReqBin online HTTP Client.
get-request rest-api json request-header

GET JSON with Curl
This is a live example of retrieving a JSON string from a REST API endpoint using Curl. Try it yourself with ReqBin online Curl client.
curl json get-request rest-api request-header

Posting JSON to the Server
Live example of posting JSON data to the server as a part of the request. The 'Content-Type: application/json' header indicates that we are sending a JSON. The 'Accept: application/json' header tells the server that we can accept JSON.
json accept-header request-header rest-api

Curl Header
An example of a sending header with Curl. The '-H "Accept: application/json"' Curl command-line parameter appends 'Accept: application/json' header to the request and informs the server that the Curl client expects a JSON. The "Content-Type: application/json" Curl header indicates the resource type in the request body.
curl request-header post-request

HTTP Headers
The browser and server use HTTP headers to pass the information on data size and type, compression methods, languages, cache directives, and origin.
http-headers response-headers entity-headers http-protocol request-header