POST/GET Request Examples

While you may send the data to the ClickaPost API directly as raw XML, the server also understands both POST and GET HTML methods. This also comes in quite handy if you want to test your XML files without much programming.

As long as your XML data is in "xml" variable - the server will accept it, parse it and respond accordingly.

To send via POST

Create a form and set it's action to our API Server URL (http://api.clickapost.com/server.php) and whichever way you decide to send the data just name the variable xml. Note: for testing purposes, please use http://api.clickapost.com/testing_server.php !!!!

<form action="http://api.clickapost.com/server.php" method="post">
<textarea name="xml" cols="50" rows="10"></textarea>
<input type="submit" value="submit" />
</form>
To send via GET

Simply call http://api.clickapost.com/server.php?xml=<request>…</request>

Note - GET may cause some issues, so even though it is supported, we recommend you either send your data via POST.

JUST TESTING? PLEASE USE THE TESTING SERVER, not the Live Server!

We all need to test before we are ready to do some real world stuff, so in order to facilitate this for you, we made it so you may always submit your data to testing_server.php instead of server.php. Testing server works exactly the same as the original server (returning the XML response and what not), however, NONE of your posts will be submitted to ClickaPost! This way you can fine tune your XML Feed without publishing a bunch of useless data (and getting your account suspended for spamming) 8-)

Here's an example of a request sent to a testing_server.php instead of server.php.

<form action="http://api.clickapost.com/testing_server.php" method="post">
<textarea name="xml" cols="50" rows="10"></textarea>
<input type="submit" value="submit" />
</form>
 
post_get_request_examples.txt · Last modified: 2009/01/14 17:50 by peconi
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki