Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

where is the option of setting longer curl argument list threshold to avoid "Argument list too long" error

Tags:

linux

curl

The shell code is: #!/bin/sh body="............a lot of thing................"; curl -Ss -d"${body}" "xx.xx.com"

But it couldn't be ran and sent via curl,the error is: /usr/bin/curl: Argument list too long

It might be the $body is too long.I wonder are there any options to set curl to send longer post?

like image 714
Leonardo Avatar asked Dec 11 '12 05:12

Leonardo


1 Answers

Store your body data in a file. and use

  curl -d @<filename>
like image 62
DhruvPathak Avatar answered Oct 11 '22 13:10

DhruvPathak