How to RAW POST huge XML file with curl - PHP
is there a way of doing curl -X POST -H "Content-Type:application/xml" --data @myfile.xml http://example.com but directly in PHP? CURLOPT_PUT / CURLOPT_UPLOAD as well as file_get_contents as well as exec are not a solutions as it must be POST and the file is huge so must be streamed. Any ideas? I had a similar problem trying to feed huge ingestion files to elasticsearch's bulk API from PHP, until I realized that the bulk API endpoint accepted PUT requests. Anyway, this code performs POST requests with huge files: $curl = curl_init(); curl_setopt( $curl, CURLOPT_PUT, 1 ); curl_setopt( $curl,