Download binary file curl
curl --request POST --data-binary "@template_entry.xml" $URL. Note that To force the 'content' part to be a file, prefix the file name with an @ sign. To just get Inside your downloadFile() function, you have return json_encode($response, JSON_PRETTY_PRINT); which seems incorrect. This encodes