I've got a website that receives Posted XML data from a third party.
I'm looking for a method so I can batch post a number of XML files to this script for development/debugging purposes.
I have built a php script that loops through an array of files and uses curl to post each file separately. However due to the开发者_Go百科 number of files i wish to post, I feel PHP isn't the best method as the script times out.
Ideally, I'm looking for a terminal process/os x application that will pick up all files in a given directory and post the contents of each one to a defined URL one by one.
Any suggestions/ideas greatly received.
Jim.
I'm a little confused. Why not just set the CURLOPT_TIMEOUT
option appropriately on your posting application ? Otherwise your PHP solution seems to be functioning ok ?
If you don't want a PHP solution, have you looked at posting via HTTP in parallel, and use some scripting language with threading support (e.g. ruby or similar). The only headache is that you're now going to be loading your server more for the benefit of your script running faster, and you need to determine what sort of load your server-side process can handle.
精彩评论