Skip to content

Instantly share code, notes, and snippets.

@nullstyle
Created August 12, 2014 16:12
Show Gist options
  • Save nullstyle/68161de20f073f50fb17 to your computer and use it in GitHub Desktop.
Save nullstyle/68161de20f073f50fb17 to your computer and use it in GitHub Desktop.
curl_test.php
<?php
$url = "https://test.stellar.org:9002";
$post_data = array(
"method" => "create_keys"
);
$data_string = json_encode($post_data);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($data_string))
);
$output = curl_exec($ch);
curl_close($ch);
echo $output;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment