Skip to content

Instantly share code, notes, and snippets.

@esseguin
Created September 21, 2012 22:38
Show Gist options
  • Save esseguin/3764331 to your computer and use it in GitHub Desktop.
Save esseguin/3764331 to your computer and use it in GitHub Desktop.
<?php
require_once("Weather.php");
// Initialize the client object with your Mashape public and private keys.
$obj = new Weather("YOUR_PUBLIC_KEY", "YOUR_PRIVATE_KEY");
// Invoke the method and get back the MashapeResponse object
$response = $obj->getForecasts("San Francisco");
// The MashapeResponse has the following properties that you can use
print "Status Code: $response->code"; // Integer status code
var_dump($response->headers); // Response headers as an array
print "Raw Body: $response->rawBody"; // String raw body of the response
var_dump($response->body); // stdClass object of parsed response body
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment