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>
http://example.com:10081/ZendServerManager/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.
|
Example The following is an example of a call to the (obviously fake) “makePizza” method (some lines are broken for readability): POST /ZendServerManager/Api/makePizza HTTP/1.1 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: GET /ZendServerManager/Api/getPizzaStatus?pizzaId=53
HTTP/1.1 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.