Skip to content

Instantly share code, notes, and snippets.

@hlthi
Last active June 17, 2019 11:21
Show Gist options
  • Save hlthi/1d9570ef202deb767cf3b310cfce5fa3 to your computer and use it in GitHub Desktop.
Save hlthi/1d9570ef202deb767cf3b310cfce5fa3 to your computer and use it in GitHub Desktop.
temp
$reportRequest = curl_init();
curl_setopt($reportRequest, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($reportRequest, CURLOPT_URL, "");
curl_setopt($reportRequest, CURLOPT_RETURNTRANSFER, true);
curl_setopt($reportRequest, CURLOPT_TIMEOUT, 10);
curl_setopt($reportRequest, CURLOPT_POST, true);
curl_setopt($reportRequest, CURLOPT_POSTFIELDS, "hi");
curl_setopt($reportRequest, CURLOPT_HTTPHEADER, array());
$reportResponse = curl_exec($reportRequest);
curl_close($reportRequest);
@hlthi
Copy link
Author

hlthi commented Jun 17, 2019

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, '');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "{\"email\":\"xxx@com.com\",\"password\":\"yoyoyoyoy\"}");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = 'Accept: application/json, text/plain, */*';
$headers[] = 'Content-Type: application/json;charset=UTF-8';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
}
curl_close($ch);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment