post-request tagged requests and articles

Categorized request examples and articles tagged with [post-request] keyword
How do I post JSON to a REST API endpoint?
To post JSON to a REST API endpoint {{using LANG}}, you must send an HTTP POST request to the REST API server and provide JSON data in the body of the {{LANG}} POST message. You must also specify the data type using the Content-Type: application/json request header. In this {{LANG}} REST API POST example, we also send the Accept: application/json request header to tell the REST API server that the {{LANG}} API client expects JSON in response.

How do I post JSON to the server?
To post JSON data to the server{{ using LANG}}, you need to provide the JSON data in the HTTP POST request body and pass the "Content-Type: application/json" request header. The Content-Type request header specifies the media type for the resource in the body. Additionally, you can pass an "Accept: application/json" header, which tells the server that the client is expecting JSON data. In this {{LANG}} POST JSON example, we send JSON data to the ReqBin echo URL with the appropriate Accept and Content-Type HTTP headers. Click Send to execute the {{LANG}} POST JSON example online and see the results.

How do I post request body with Curl?
To send data to the server in the POST request body, you must pass the required data to Curl using the -d or --data command line switch and specify the data content type using the -H command line switch. The Content-Type header is required for the server to correctly interpret and process the data in the body of the POST message. For example, if you send JSON to a server, you must specify the content type of the data in the body of the POST message using the Content-Type header: application/json and application/xml for XML. In this example, we send the request body to the ReqBin echo URL using Curl. Click Run to execute Curl POST Body example online and see results.

How do I send an POST request?
The HTTP POST method sends data to the server to create/update a resource on the server. The POST data is included in the body of the {{LANG}} POST message. The Content-Type request header indicates the data type in the POST body, and the Content-Length request header indicates the data size in the {{LANG}} POST request. In this {{LANG}} POST Request example, we send data to the ReqBin echo URL with Content-Type and Content-Length HTTP headers. Click Send to execute the {{LANG}} POST Request example online and see the results.

What is the Content-Length header?
The Content-Length header specifies the data size in the HTTP message's body. Browsers automatically add Content-Length and Content-Type headers based on the size and type of data sent to the server. To manually pass the Content-Length header to the server{{ using LANG}}, you need to add the Content-Length: [length] and Content-Type: [mime type] headers to your request, which describes the size and type of data in the body of the POST request. The data length must be specified in bytes. In this {{LANG}} Content-Length Header Example, we make a POST request to the ReqBin echo URL and send data to the server in the body of the POST message. Click Send to run {{using LANG}} Content-Length Header example online and see the results.

How do I make a POST API request?
To make a POST request to an API endpoint{{ using LANG}}, you need to send an HTTP POST request to the server and specify a Content-Type request header that specifies the data media type in the body of the POST API request. The Content-Length header indicates the data size in the POST message body. In this {{LANG}} POST API Request example, we send a POST request to the ReqBin echo API URL. Click Send to execute the {{LANG}} POST API Request online and see results.

How to post XML with the correct Content-Type header?
To post XML to the server{{ using LANG}}, you need to make an HTTP POST request, include the XML data in the body of the POST request message, and set the correct MIME type for the XML using the "Content-Type: application/xml" HTML header. Optionally, you can send an "Accept: application/xml" request header that will tell the server that the client is expecting XML in response. The server specifies the data type in the response using the "Content-Type: application/xml" HTTP response header. In this {{LANG}} Post XML Example, we send a request with XML data to the ReqBin echo URL and pass the Content-Type: application/xml HTML header. Click Send to execute the {{LANG}} POST XML example online and see the results.

How do I POST JSON string with Basic Authentication?
To post JSON to a server with Basic Authentication credentials, you need to make an HTTP POST or PUT request, include the JSON in the body of the HTTP message, and pass the "Authorization: Basic [token]" HTTP header to the server. The [token] is a Base64 encoded string of user credentials in the form of a login:password string. In this POST JSON with a Basic Authentication Credentials Example, we send a POST request with JSON body and "Authorization: Basic [token]" header to the ReqBin echo URL. Click Send to execute POST JSON with Basic Authentication example online and see the results.

How do I post XML using Curl?
To post XML using Curl, you need to pass XML data to Curl with the -d command line option and specify the data type in the body of the POST request message using the -H Content-Type: application/xml command line parameter. In this Curl POST XML example, we also pass the Accept: application/xml request header to tell the server that the Curl client expects XML from the server. Click Run to execute the Curl POST XML Example online and see the results.

POST Requests Online
Post requests to the server and check server responses. Fully Online; no desktop app needed. Test Server endpoints by sending HTTP POST, GET, PUT, and HEAD requests directly from your browser. Create PHP, Python, Java, Curl, and JavaScript code snippets from your requests with one click. Share your HTTP requests online, showcase your work, or discuss with colleagues and friends.

How do I use curl -d option?
The curl -d (or --data) command line argument tells Curl to send the passed data to the server in the body of the HTTP message. When you pass data to Curl with the -d command line argument, Curl, by default, sends the data to the server in the Content-Type: application/x-www-form-urlencoded format. To send data in a different format, you must specify the correct content type with the -H command line argument. The Content-Type request header is required for servers to correctly interpret and process the data in the POST message body. In this Curl -d example, we send the data to the ReqBin echo URL. Click Run to execute the Curl -d request online and see the results.

Convert Latitude and Longitude to Address via REST API
Convert latitude and longitude to a location (reverse geocode) by sending a POST request to the Mapquest.com REST API. Replace {mapquest_apikey} with your own Mapquest API key.

Search Map Objects by Address via REST API
Search the objects on the map next to the address by sending a POST request to the Mapquest.com REST API. Replace {mapquest_apikey} with your own Mapquest API key.

Search Map Objects by Latitude and Longitude via REST API
Search the objects on the map using a latitude/longitude pair by sending a POST request to the Mapquest.com REST API. Replace {mapquest_apikey} with your own Mapquest API key.

What is HTTP POST Request Method?
The HTTP POST method is one of the most commonly used HTTP methods. It is used to send data to the server or to create or add a resource on the server.

What is HTTP PATCH Request Method?
The PATCH method is one of 9 common request methods supported by the Hypertext Transfer Protocol (HTTP) and used to partially modify an existing resource, as opposed to HTTP PUT, which replaces the entire resource.

What is the difference between the HTTP PUT and POST request methods?


What is a Proxy Server?