rest-api tagged requests and articles

Categorized request examples and articles tagged with [rest-api] 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

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

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

IP Address Details via REST API
This page shows how to get details for the selected IP addresses by sending a GET request to the IPInfo.io REST API. Replace {ipinfo_apikey} bearer token with your own API token.
ip-address get-request rest-api bearer-token api-token ipinfo

Current Weather Data for the Selected City via REST API
This page shows how to get the current weather data for the selected city by sending a REST API request to the OpenWeather API endpoint. The weather REST API key is passed in the "openweathermap_apikey" URL parameter. The city name is passed in the 'q' URL parameter. The weather REST API supports HTTP GET requests.
rest-api get-request openweather weather-data city-wather openweather-api weather-api

Latest Foreign Exchange Rates via REST API
This page shows how to get the latest foreign exchange rates (forex) by sending a GET request to the Fixer.io REST API. Replace {fixer_apikey} with your own Fixer API key.
rest-api get-request forex exchange-rates fixer fixer-api

DELETE Request Example
This page demonstrates how to send a DELETE request to an HTTP API endpoint with Bearer token authorization header.
delete-request delete-method rest-api

List of Popular Photos via REST API
Get a page with a list of photos sorted by popularity by sending a GET request to the Unsplash.com REST API. Replace {unsplash_apikey} with your own Unsplash Access key.
rest-api get-request unsplash unsplash-api photos-api popular-photos

GET Request to Retrieve a JSON
This page demonstrates how to send a GET request to REST API endpoint with Accept: application/json and Bearer token in authorization headers.
get-request json rest-api get-method

PUT JSON String
An example of sending a PUT request with JSON string to the REST API endpoint. The 'Accept: application/json' request header tells the server that the client expects JSON. The 'Content-Type: application/json' request header indicates the media type of the resource in the request body.
put-request json rest-api put-method submit-data

Astronomy Picture of the Day via REST API
Get the astronomy picture of the day (APOD) by sending a GET request to the Nasa.gov REST API. Replace {nasa_apikey} with your own Nasa API key.
rest-api get-request nasa nasa-api astronomy-picture

Curl PATCH JSON String
An example of a Curl command for sending a PATCH request with JSON content string to the REST API endpoint. Try it yourself with ReqBin online Curl Client.
curl json patch-request path-method rest-api submit-data

Curl PUT JSON Example
An example of Curl command for updating a resource on the server by sending a PUT request with JSON string to the REST API endpoint.
curl json put-request rest-api put-method submit-data

Photo Details and Download Links via REST API
Get complete information of a photo, including size, author name, location, and download links by sending a GET request to the Unsplash.com REST API. Replace {unsplash_apikey} with your own Unsplash Access key.
get-request unsplash rest-api access-key photo-details photo-download unsplash-api

Post DELETE Request
An example of deleting an object from the server by sending a DELETE request to the REST API endpoint.
delete-request rest-api delete-method delete-data

Geocode Address via REST API
Get the associated latitude and longitude for an address by sending a POST request to the Mapquest.com REST API. Replace {mapquest_apikey} with your own Mapquest API key.
rest-api post-request mapquest geocode geocode-address mapquest-ap

Search Photos via REST API
Get a page of search results for photos sorted by relevance by sending a GET request to the Unsplash.com REST API. Replace {unsplash_apikey} with your own Unsplash Access key.
rest-api get-request unsplash search-photos unsplash-api

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.
post-request mapquest rest-api reverse-geocode geocode mapquest-api

Foreign Exchange Reference Rates REST API Example
This page shows how to get the foreign exchange reference rates from exchangeratesapi.io service. Rates are quoted against the USD base currency. No API key is required.
rest-api forex exchangeratesapi exchangerates-api exchange-rates

NASA Image and Video Library via REST API
Access the NASA Image and Video Library by sending a GET request to the Nasa.gov REST API. Replace {nasa_apikey} with your own Nasa API key.
rest-api nasa get-request nasa-api nasa-image nasa-video

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.
rest-api post-request mapquest mapquest-api search-map search-address

PATCH JSON String
An example of sending a PATCH request with JSON content string to the REST API endpoint. Try it yourself with ReqBin online HTTP Client.
patch-request json rest-api path-method submit-data

POST JSON String With Basic Authentication
This page shows how to send a JSON string with Basic authentication header "Authorization: Basic bG9naW46cGFzc3dvcmQ=".
post-request json basic-authentication authentication-header post-json rest-api authorization

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

Mars Rover Photos via REST API
Get Mars photos gathered by NASA's Curiosity, Opportunity, and Spirit rovers on Mars by sending a GET request to the Nasa.gov REST API. Replace {nasa_apikey} with your own Nasa API key.
rest-api nasa get-request nasa-api nasa-mars-api mars-photos

DELETE Request Curl Example
An example of how to send a Curl command with DELETE request to the REST API endpoint.
curl delete-request delete-method rest-api

Current Weather Data by Geographic Coordinates via REST API
This page shows how to get the current weather data by geographic coordinates by sending a GET request to the OpenWeather REST API. Replace {openweathermap_apikey} with your own API key.
rest-api openweather get-request weather-api weather-data openweather-api

Current Weather Data by ZIP Code via REST API
This page shows how to get the current weather data by ZIP code by sending a GET request to the OpenWeather REST API. Replace {openweathermap_apikey} with your own API key.
rest-api get-request openweather weather-data weather-api openweather-api

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

HTTP POST Request
An example of an HTTP POST request. The The 'Content-Type: application/json' request header indicates the POST request body media type. The 'Content-Type: application/json' response header informs the client that the server returned an JSON as a result of executing this POST request.
http-request post-request json post-method rest-api 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 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

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 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 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 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

POST JSON with Basic Authentication Credentials
This page shows how to post JSON string with Basic authentication credentials in the header. Try it yourself with ReqBin online HTTP Client.
post-request json basic-authentication credentials authorization rest-api

POST Form URL-encoded Data
An example of POST request to submit form URL-encoded data to HTTP API endpoint. Try it yourself with ReqBin online HTTP Client.
post-request submit-form urlencoded post-method rest-api post-form submit-data

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 Bearer Authentication Credentials
This page shows how to make a GET request with Bearer authentication credentials in the header. Try it yourself with ReqBin online HTTP Client.
get-request bearer-token credentials rest-api get-method authorization

Convert Curl to HTTP GET Request
Convert Curl command to the HTTP GET request. See the GET Header and body on the Raw tab.
curl get-method get-request rest-api

POST JSON with Bearer Authentication Credentials
This page shows how to post JSON string with Bearer authentication credentials in the header. Try it yourself with ReqBin online HTTP Client.
post-request json bearer-token credentials rest-api authorization

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

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

Send JSON String
Live request example of sending JSON string to REST API endpoint with a custom Content-Type: application/json header.
post-json custom-header content-type json rest-api

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

PATCH Request Example
This page demonstrates how to send a PATCH request to an HTTP API endpoint with Bearer token in authorization headers.
patch-request bearer-token authorization-header rest-api authorization

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

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

Convert Curl to POST JSON Request
Convert Curl command to the HTTP POST JSON request. See the POST Header and JSON on the Raw tab.
curl json rest-api post-request post-method

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

GET Request
An example of sending a GET request to the server.
get-request json rest-api

Convert Curl to HTTP POST Request
Convert Curl command to the HTTP POST request. See the POST Header and body on the Raw tab.
curl post-method rest-api post-request json

REST API Example
A Live example of sending data to the REST API endpoint. Data is sent in JSON format. Accept: application/json header indicates that the client can receive data in JSON format. Run this example Yourself.
rest-api post-request json

JSON Comment Example
An example of including a comment in a JSON. Comments in the form // ... or / * ... * / are not allowed in JSON, but you may have a special element in your JSON, called for example, "_comment", which will contain your comment. The REST API endpoint must ignore this special JSON comment element.
json rest-api

REST API
REST API provides an interface for applications to interact with sites by sending and receiving data as JSON (JavaScript Object Notation) objects to the endpoints (URLs) to query, modify and create content on the site.
json rest-api

SOAP vs REST
SOAP and REST are known as two of the most common API paradigms. The key difference between SOAP and REST is the way they interact with the server.
json xml rest-api soap-api

HTTP Methods for CRUD Operations
The CRUD-based REST API maps CRUD operations to HTTP verbs in the following format: POST - create or add a resource, GET - request a resource, PUT - update an existing resource, PATCH - make partial changes and DELETE - delete a resource.
crud http-method rest-api

SOAP API
SOAP is an XML-based messaging protocol specification that strictly defines an entire method of communication between the client and the server.
json xml rest-api soap-api