Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php $curl = curl_init();
- $streamVerboseHandle = fopen('php://temp', 'w+');
- curl_setopt_array($curl, array(
- CURLOPT_URL => 'http://wa.jagojoki.id:3333/sessions/add',
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_ENCODING => '',
- CURLOPT_MAXREDIRS => 10,
- CURLOPT_TIMEOUT => 0,
- CURLOPT_FOLLOWLOCATION => true,
- CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
- CURLOPT_CUSTOMREQUEST => 'POST',
- CURLOPT_POSTFIELDS => 'id=john&isLegacy=false',
- CURLOPT_HTTPHEADER => array(
- 'Content-Type: application/x-www-form-urlencoded'
- ),
- CURLOPT_VERBOSE => true,
- CURLOPT_STDERR => $streamVerboseHandle
- ));
- echo $response = curl_exec($curl); echo '<br/><br/>';
- if ($response === FALSE) { printf( "cUrl error (#%d): %s<br>\n", curl_errno($curl), htmlspecialchars( curl_error($curl) ) ); }
- rewind($streamVerboseHandle);
- $verboseLog = stream_get_contents($streamVerboseHandle);
- echo "cUrl verbose information:\n", "<pre>", htmlspecialchars($verboseLog), "</pre>\n";
- curl_close($curl); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement