简体   繁体   中英

Send files via cURL post PHP. XML or plain text?

So I've been working for around two months with cURL post requests via php and when it's about sending files I've been using the .txt extension files and my questions are:

Is it better (or even possible) to send the data as a .xml file?

And if yes, curl_file_create() function also works with .xml files or is there another way to accomplish this?

Is it better to send the data as a .xml file?

Yes. No. Maybe.

It depends on what the server expects you to send.

It depends on what format is most suitable for expressing the information you are sending.

JPEG might be the best format!

curl_file_create() function also works with .xml files

It deals with files . Nowhere does it say it only deals with particular types of file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM