HTTP Methods
The platform mainly uses 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 AgSync 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.agsync.com/api/blends/
An example response is shown below.
201 Created
Location: https://dispatch.agsync.com/api/blends/123
Where /123
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 AgSync 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.
To indicate a failed operation, an error body and status code is returned.