Skip to content

Instantly share code, notes, and snippets.

@rbalazs
Created January 20, 2020 18:03
Show Gist options
  • Save rbalazs/08e8131efbe74af80e168114037061bc to your computer and use it in GitHub Desktop.
Save rbalazs/08e8131efbe74af80e168114037061bc to your computer and use it in GitHub Desktop.
easiest_post
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"http://172.17.0.3:6616/");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen(json_encode($payload)))
);
$prediction = curl_exec($ch);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment