curl large file as POST request

北战南征 提交于 2020-01-15 11:48:34

问题


I have a number of ~10MB xml files on a local computer. For each file, I need to send it to a remote server for processing. The way I attempted to do this was by using curl to POST to a function:

curl MyIP -d @my_file.xml 

Where MyIP is the url of the function that does the xml processing. However, this seems to be problematic, as most of the POST data is cut off due to some limitation (though I'm not sure what this limitation is).

What would be the suggested way to send a ~10MB file to a remote server for text processing? Could I set up the above way using curl & a function to work? Should I set up an FTP and then run a cron job on the folder?


回答1:


Use POST

curl -X POST -d @my_file.xml http://user:pass@myhost/

By default curl uses "GET" verb. You have to specify the HTTP verb using option -X



来源:https://stackoverflow.com/questions/11164847/curl-large-file-as-post-request

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!