top of page

What is the composition of the URL? in REST API

A REST API is accessed with an endpoint URL. The endpoint URL consists of a base URL, a resource path, and query parameters. The base URL is the internet host name for the REST API. The resource path is the address to the API resource. Query parameters are name/value pairs passed to the REST API after a ? in the endpoint URL. Query parameters pass inputs to a REST API and are often used to filter, sort, or specify the output format.

  • Base URL: Enter base URL for the web service endpoint.

  • Resource Path: Enter the path to the complete web service endpoint.

  • Query Parameters: Enter a name and value for each query parameter to pass. Query parameters are appended to the endpoint after a ? in the URL at runtime.

In above URL

Base URL:

It is a hostname or domain name. Additionally, it can be obtained from the domain registrar to name the website domain. Moreover, it often ends with .com , .net, .in, etc.

Resource Path:

It is a path. Additionally, the directory structure of a web server determines the paths.

Query Parameters:

A set of parameters attached to the end of the URL is called Query Parameters. They are appended to the URL by adding ‘?’ at the end of the URL. In addition to that, they are followed immediately with a key-value pair(Query Parameter).

In simple words, Query Parameters are a set of parameters attached to the end of the URL. Additionally, it helps to retrieve specific data and performs actions based on the inputs passed by the user. Also a ‘?’ is used immediately after the URL to append the query parameters to the URL. E.g., if you paste this URL ( on the browser address bar and press enter. Consequently, google page will open with displaying Google search results for the word “tiger.”

In the case of multiple parameters, we add an ‘&’ symbol in between each of the query parameters. Note that these requests are used commonly in the GET Requests only. In other words, we use the Query Parameters when an operation involves sort, pagination, or filter operation on the items.

For instance, in the below example, I am searching for the word ‘tiger’ on Google. As I enter the word ‘tiger’ in the search box, consequently, the resulting URI gets changed to:


10,657 views1 comment

Recent Posts

See All

1 則留言

評等為 0(最高為 5 顆星)。

評等為 5(最高為 5 顆星)。

You saved my job

bottom of page