REST

Examples of how to use Bi-direct to make REST API calls.

To make a REST API call using this middleware, you need to make an API call to Bi-direct middleware.

Bi-Direct endpoint for REST: https://tri-way.vercel.app/rest

To make the API call, you need to send a POST request to the middleware endpoint, passing the required data in the request body. The middleware will read the request body and make the API call based on the data passed.

To pass the required data in the request body, you need to include a JSON object with the following keys:

  • Url: The endpoint URL of the REST API you want to use

  • Method: The HTTP method for the API call (POST, GET, PUT, DELETE, etc.)

  • Data (optional): The request body data for the POST or PUT request

Example of a GET request

Headers

headers: {
    'Content-Type': 'application/json'
  }

Request Body (GET request)

{
  "Url": "https://jsonplaceholder.typicode.com/users",
  "Method": "GET",
}
Generated output for the given GET request
Javascript code (Axios)

Example of a POST request

Headers (Will be same as GET request)

Request Body (POST request)

Generated output for the given POST request

Last updated