post-json tagged requests and articles

Categorized request examples and articles tagged with [post-json] keyword
POST JSON Example
An example of posting a JSON string to the REST API endpoint. In this post JSON example, 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.

Curl POST JSON Example
An example of a Curl command to post JSON to the API endpoint. To post JSON with Curl, you need to set the content type to application/json. This is done by the -H "Content-Type: application/json" command-line option. The JSON is passed with the curl -d option. Double quotes in JSON are escaped with \".

REST API POST Example
An example of posting JSON to the REST API endpoint. In this REST API POST example, the Content-Type: application/json request header specifies the media type of the resource in the body as JSON. The Accept: application/json request header tells the server that the client expects a JSON string. The Content-Type: application/json response header indicates that the server returned JSON.

POST JSON String With Basic Authentication
An example of posting JSON string with basic auth credentials. The user authentication credentials are automatically converted to the Base64 encoded string and passed to the server with Authorization: Basic bG9naW46cGFzc3dvcmQ= request header.

REST API Example
An example of sending JSON data to the REST API endpoint. The Accept: application/json request header indicates that the client wants to receive data in JSON format. The Content-Type: application/json response header informs the client that the server has returned JSON.