Created
October 18, 2017 19:44
-
-
Save raddeus/a02c7fcb8ecec37c90f515dacc5fc506 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$postBody = [ | |
'test' => 'test' | |
]; | |
$baseUrl = 'http://localhost:4000'; | |
$ch = curl_init(); | |
curl_setopt($ch, CURLINFO_HEADER_OUT, TRUE); | |
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); | |
curl_setopt($ch, CURLOPT_HEADER, TRUE); | |
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); | |
curl_setopt($ch, CURLOPT_URL, $baseUrl); | |
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($postBody)); | |
//curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_NTLM); | |
//curl_setopt($ch, CURLOPT_USERPWD, $userpwd); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt($ch, CURLOPT_HTTPHEADER, array( | |
'Content-Type: application/json' | |
)); | |
$result = curl_exec($ch); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment