get-request tagged requests and articles

Categorized request examples and articles tagged with [get-request] keyword
GET Request Example
An example of sending an HTTP GET request to the server to get a resource at the specified URL. In this GET request example, the Accept: */* request header tells the server that the client accepts all types of media. The Content-Type: text/html response header informs the client that the server has returned HTML for this GET request.

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.

GET JSON Example
An example of getting JSON from the URL. In this get JSON example, the client sends an Accept: application/json request header to the provided URL to tell the server that it expects JSON. The Content-Type: application/json response header informs the client that the server has returned JSON.

Curl Get URL
An example of getting a URL with Curl. The target URL is passed as the second command line parameter. Curl automatically selects the GET method to use unless the -X, --request, and -d command-line options are used. The Accept: */* header is automatically added by Curl to the 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.

Curl GET JSON Example
An example of a Curl command to get JSON from the server. The Accept: application/json request header is passed to the server with the curl -H command-line option and tells the server that the client is expecting JSON. The server indicates that it has returned JSON data with a Content-Type: application/json response 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.

GET Request With Basic Server Authentication
An example of sending a GET request with the basic server authentication credentials. For the basic server authentication, the Authorization: Basic {credentials} header is added to the request. Where the {credentials} is a Base64 encoded string of username and password pair joined by a single colon :

GET XML Example
An example of getting an XML data from a website. 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 Command With Basic Server Authentication Header
An example of a Curl command with basic auth credentials. The user authentication credentials are passed with --user "login:password" Curl command line parameter. Curl automatically converts the "login:password" pair to the Base64 encoded string and adds the 'Authorization: Basic bG9naW46cGFzc3dvcmQ=' header to the request.

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.

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

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 Example
An example of sending a GET request to the REST API endpoint. In this REST API GET example, 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 for this GET request.

Send Custom Headers with Curl
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.

Convert Curl to HTTP Request
Convert Curl command to the HTTP request. Enter your Curl request, click Send to check if you entered it correctly, and then click the Raw tab to see the HTTP request. You can also convert Curl request to PHP, Python, JavaScript, and C# code.

GET Request With Custom Headers
An example of sending a custom request header to the server. In this example, the name of the custom header is X-Real-IP and the value is 39.40.130.50.

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.

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.

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.

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 Country Code by IP Address via REST API
This page shows how to get the country code by IP address by sending a GET request to the IPInfo.io REST API. Replace {ipinfo_apikey} bearer token with your own API token.

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.

Curl GET Request
An example of making a GET request using Curl. Curl automatically selects the GET method unless the -X, --request, or -d command-line options are passed. The target URL is passed as the first command-line parameter. The second command-line parameter tells the server that the Curl client is expecting JSON.

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.

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.

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.

HTTP GET
The HTTP GET method is used to request a resource from the server. The GET requests cannot have a message body but you still can send data to the server using the URL parameters. HTTP GET requests should only receive data (the server must not change its state). If you want to change data on the server, use POST, PUT, PATCH or DELETE methods.