Created
February 15, 2017 18:13
-
-
Save marcosnakamine/b5ab761867a5d73430ffa8e72d1fd80e to your computer and use it in GitHub Desktop.
PHP - Sending header in cURL
This file contains hidden or 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
<?php | |
$ch = curl_init(); | |
curl_setopt( $ch, CURLOPT_URL, 'http://url.com' ); | |
curl_setopt( $ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/xml' ) ); | |
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); | |
$output = curl_exec( $ch ); | |
curl_close( $ch ); | |
var_dump( $output ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment