HTTP Methods
The Dispatch Pro platform has specific behaviour for the following HTTP methods:
- GET
- POST
- PUT
- DELETE
GET
GET operations default to application/json
content type. To override this specify the Accept
header in the request. The only other supported type is text/html
.
POST
POST operations currently will return either the object that was created or no content by default. It is intended that eventually all POST operations will return no content by default. These operations will support the Location response header to specify the location of any created resource that was not explicitly named, via the Location header.
Not all Dispatch Pro services currently support this.
As an example, imagine a service that allows creation of hosted servers, which will be named by the service:
POST https://dispatch.ravenslingshot.com/api/fieldoperations
An example response is shown below.
204 Created
Location: https://dispatch.ravenslingshot.com/api/fieldoperations/00000000-0000-0000-0000-000000000000
Where "00000000-0000-0000-0000-000000000000" is the service-allocated id.
Services may also return the full metadata for the created item in the response using the Prefer
header.
See Request Headers for further information.
PUT
PUT operations currently will return either the object that was created or no content by default. It is intended that eventually all PUT operations will return no content by default. These operations will support the Location response header to specify the location of any created resource that was not explicitly named, via the Location header.
Not all Dispatch Pro services currently support this.
Services may also return the full metadata for the created item in the response using the Prefer
header.
See Request Headers for further information.
DELETE
DELETE operations return 204 No Content for a successful deletion, or an error body with status code to indicate failure.