Endpoints

Whenever you need to describe a REST API method in dexi.yml you'll find the same sort of structure being used.

An overview of the properties available can be seen in the table below

PropertyDescriptionRequired?
typeThe type of endpoint. Only HTTP is supported right nowNo
urlThe absolute url of the endpointYes
methodThe HTTP method to use. One of GET, POST, PUT, DELETE, PATCH. POST and PUT are usually recommended though since those allow for request bodies which is required for almost all endpoints.Yes
headersAn array of name and value objects - e.g.:
json [ { "name":"Accept", "value":"application/json" } ]

The example below shows how that might look when using all the available properties:

endpoint:
  type: HTTP # Can be omitted
  url: https://my-app-api.public.com/method/invoke
  method: POST
  
  # You can use headers to send certain values along with every request
  # Even including a shared secret here makes sense to make sure it is 
  # your app calling your endpoint
  headers: 
  - name: Accept
  	value: application/json
  - name: User-Agent
  	value: MyApp/1.0