0

Im trying to send a long encrypted string with curl to an api and it gives me this

curl http://host.net/crypto.php?api=XXXXXXXX\&name=XXXX\&msg=$key
bash: /usr/bin/curl: Argument list too long```

If i try to send a file

curl http://host.net/crypto.php?api=XXXXXXX\&name=XXXX\&msg="@/tmp/.sendenc"

The server just gets @/tmp/.sendenc

The first way works fine with shorter strings but not with longer...

idk if this helps but its sending an encrypted image about 417025 letters :/

defines
  • 10,229
  • 4
  • 40
  • 56
  • 1
    It might be because your URI is too long - see https://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers/417184#417184 – zmike Aug 16 '20 at 19:20
  • @zmike Thank you! That actually makes alot of sense do you have suggestions on how i could send/transfer the data? –  Aug 16 '20 at 19:23
  • 2
    Break up the data somehow, or use POST requests instead of GET. See https://ec.haxx.se/http/http-post or https://stackoverflow.com/questions/7172784/how-do-i-post-json-data-with-curl for examples. – zmike Aug 16 '20 at 19:26
  • Use POST for any long set of datas – Alexandre Elshobokshy Aug 16 '20 at 19:46

0 Answers0