-
-
Save masazdream/6026844 to your computer and use it in GitHub Desktop.
curl php で binary data を no key name で送る。
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
$ch2 = curl_init($url); | |
curl_setopt($ch2, CURLOPT_SSL_VERIFYPEER, FALSE); // -k | |
curl_setopt($ch2, CURLOPT_POST, TRUE); // POST | |
curl_setopt($ch2, CURLOPT_BINARYTRANSFER, TRUE); // --data-binary | |
curl_setopt($ch2, CURLOPT_HTTPHEADER, ['Content-Type: text/xml;charset=utf-8', 'User-Agent: curl']); // Http Header | |
// 返り値を文字列として受け取る場合はONに | |
//curl_setopt($ch2, CURLOPT_RETURNTRANSFER, TRUE); | |
//curl_setopt($ch2, CURLOPT_TRANSFERTEXT, TRUE); | |
//curl_setopt($ch2, CURLOPT_COOKIESESSION, TRUE); | |
curl_setopt($ch2, CURLINFO_HEADER_OUT, TRUE); | |
$xml_flie = 動画のフルパス; | |
$postdata = file_get_contents($xml_flie); | |
curl_setopt($ch2, CURLOPT_POSTFIELDS, $postdata); | |
$response = curl_exec($ch2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment