30.07.2012 Views

Reference Guide

Reference Guide

Reference Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Examples<br />

Example<br />

Web API <strong>Reference</strong> <strong>Guide</strong><br />

The following is an example of a call to the (obviously fake) “makePizza” method<br />

(some lines are broken for readability):<br />

POST /ZendServerManager/Api/makePizza HTTP/1.1<br />

Host: zscm.local<br />

Date: Sun, 11 Jul 2010 13:16:10 GMT<br />

User-agent: Zend_Http_Client/1.10<br />

Accept: application/vnd.zend.serverapi+xml;version=1.0<br />

X-Zend-Signature: bob.at.example.com;<br />

7f0db29a3d82a81ec6f5387f5aae96e295530b4c8acf2074488185902dc900f4<br />

Content-type: application/x-www-form-urlencoded<br />

Content-length: 100<br />

style=thinCrust&extraCheese=TRUE&extras%5B0%5D=pepperoni&extras%5B1<br />

%5D=onion&extras%5B2%5D=pineapple<br />

The request above is for the “makePizza” method, with the following parameters: style,<br />

extraCheese, extras.<br />

The following example shows a call to a read-only “getPizzaStatus” method:<br />

GET /ZendServerManager/Api/getPizzaStatus?pizzaId=53 HTTP/1.1<br />

Host: zscm.local|<br />

Date: Sun, 11 Jul 2010 13:16:10 GMT<br />

User-agent: Zend_Http_Client/1.10<br />

Accept: application/vnd.zend.serverapi+xml;version=1.0<br />

X-Zend-Signature: bob.at.example.com;<br />

02dcbf4cb338a0a8b807c83a84a7888929f5c06491105d6752f290da47a24619<br />

Notice that the ‘pizzaId’ parameter is passed as part of the URL’s query string.<br />

331

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!