API Requests - Getting Started

Create a simple GET request

๐Ÿ“˜

To create a request, you must have an API Project. If you do not have an API Project, you can create a simple one named My API Requests (or similar) to act as your playground for playing with API Requests.

  1. Navigate to https://rapidapi.com/studio or click the My APIs link in the header of the API Hub. You may need to log in before accessing it.

  2. In the dropdown in the upper right, select Personal. This will display the API Projects in your Personal Account.

  3. Click on the API Project that you would like to use for sending requests. If needed, you can create one by clicking Add API Project in the upper right.

25222522
  1. In the center frame, next to Requests, click the + (Add Request).
20602060
  1. Click the new Request 1 request.

  2. In the HTTP method dropdown, select GET (it should already be selected).

  3. In the URL box to the right of the HTTP method dropdown, enter https://echo.paw.cloud. This is a simple service that responds with information about the request.

  4. Click Send. On the right, you should see a 200 OK response as well and information about the request.

27982798
  1. Click the Description tab in the center frame and rename the request GET Echo.

Create a POST request

  1. Click the vertical three dot menu next to your GET echo request (created above) and select Duplicate.

  2. Click the GET Echo Copy request.

  3. Change the HTTP method to POST.

  4. In the Description tab, change the request's name to POST Echo.

  5. Click the Headers tab and add header with a name of My-Test-Header and a value of Testing!.

21942194
  1. Click the Query parameter tab and enter a query parameter with a name of testqueryparameter and a value of myqueryvalue. This will append ?testqueryparameter-myqueryvalue to the request URL.

  2. Click the Body tab. Click JSON. Enter the following request body:

{"my-body-key": "my-body-value"}
21902190
  1. Click the Auth tab. Click Basic. Enter a Username of dummy and a Password of dummy.

  2. Click Send to send the request. Verify the following in the Response:

  • You receive a 200 OK response.
  • Your POST request URL has your testqueryparameter appended to it.
  • Your My-Test-Header was sent.
  • An Authorization header with an encoded value was sent. The API client Base64 encoded your Username and Password for you.
  • Your JSON body was sent with the request.
  1. In the Preview window in the bottom center, select the Node.js / Axios library from the dropdown (or your favorite option) and notice that the sample code is configured for you, including your query parameter, request headers and request body.
31743174