Skip to content

Instantly share code, notes, and snippets.

@jgraup
Last active December 29, 2015 08:59
Show Gist options
  • Save jgraup/7647716 to your computer and use it in GitHub Desktop.
Save jgraup/7647716 to your computer and use it in GitHub Desktop.
<?php
require_once (__DIR__ . "/lib/Unirest.php");
$response = Unirest::post("http://httpbin.org/post", array( "Accept" => "application/json" ),
array(
"parameter" => 23,
"foo" => "bar"
)
);
$response->code; // HTTP Status code
$response->headers; // Headers
$response->body; // Parsed body
$response->raw_body; // Unparsed body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment