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
Property | Description | Required? |
---|---|---|
type | The type of endpoint. Only HTTP is supported right now | No |
url | The absolute url of the endpoint | Yes |
method | The 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 |
headers | An 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
Updated about 5 years ago