卷曲大文件作为POST请求 [英] curl large file as POST request
问题描述
我在本地计算机上有多个〜10MB的xml文件。对于每个文件,我需要将其发送到远程服务器进行处理。我尝试执行此操作的方法是使用 curl
将POST发布到函数:
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
其中 MyIP
是执行xml处理的函数的url。但是,这似乎有问题,因为大多数POST数据由于某些限制而被切断(尽管我不确定这个限制是什么)。
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).
什么将〜10MB的文件发送到远程服务器进行文本处理的建议方法是什么?我可以使用curl&设置上述方式吗?工作的功能?我应该设置FTP,然后在文件夹上运行cron作业吗?
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?
推荐答案
使用POST
curl -X POST -d @my_file.xml http://user:pass@myhost/
默认情况下,curl使用 GET动词。您必须使用选项 -X
By default curl uses "GET" verb. You have to specify the HTTP verb using option -X
这篇关于卷曲大文件作为POST请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!