The request format defines the required format for each request sent to Zend Server. The request format for all Zend Server Web API requests are formatted as described in this page, regardless of the specific method used.
Web API HTTP requests use HTTP GET for read-only API calls, and HTTP POST for all state changing API calls.
The request URL is different for each action, and is in one of the following formats:
http://example.com:10081/ZendServer/Api/<ACTION>
All HTTP requests must include the following HTTP headers:
In addition, you should send the Accept HTTP request header to designate your supported API version(s). If the Accept header is missing, the server will fall back to the default API version. This is described in detail in API Versioning Negotiation.
For POST requests, including any parameters or payload, clients must set the Content-type header to either "application/x-www-form-urlencoded" or "multipart/form-data", depending on the payload. You must specify the size of the request body as required by the HTTP/1.1 protocol, that is by using the Content-length header, the Content-transfer-encoding: chunked header or simply by closing the connection.
API methods that require passing parameters may be passed in the following forms:
Refer to specific method documentation for a list of required and optional parameters.
|
The following is an example of a call to the (obviously fake) “makePizza” method (some lines are broken for readability):
The request above is for the “makePizza” method, with the following parameters: style, extraCheese, extras. The following example shows a call to a read-only “getPizzaStatus” method:
Notice that the ‘pizzaId’ parameter is passed as part of the URL’s query string. |
|
|
|
Related Links: Response Format |
|
|
© 1999-2013 Zend Technologies, Ltd. All rights reserved.