To construct a GET transaction using the Connection Manager, you will need to construct a querystring of key-value pairs and append it to the URL. The following code example provides a step-by-step approach to creating a simple GET transaction.
Load the YAHOO namespace and connection manager source file:
Construct a querystring with two key-value pairs of username = anonymous and userid = 0:
Create a callback object to handle the response, and pass an object literal to both success and failure as the argument.
Call YAHOO.util.Connect.asyncRequest to send the request to get.php, and the PHP file will return the output of $_POST via print_r(). The handleSuccess callback will print the response object's properties, including the server response data.
Note: Caching and GET idempotency.