I don't want cURL in my WordPress plugin
Hi, cURL is not safe to use on WordPress site. And sometime, cURL has been disable on customer hosting.
And i decided to use wp_remote_post to send file for my plugin
Here my code :
$service = URL SERVICE ; $headers = array( 'accept' => 'application/json', // The API returns JSON 'content-type' => 'application/binary', // Set content type to binary ); $data = array( 'headers' => $headers, 'body' => file_get_contents($image_file), ); $response = wp_remote_post($service, $data);
But on server, i cannot received file from wp_remote_post. Please help me fix this issue ? How i can config to send file from wp_remote_post same as CURLFile ?