0

Is it possible to use content from a URL to do Curl -data-binary POST?

POST content from a file:

curl -X POST -H "Content-Type: plain/text" --data-binary "@file.txt"  http://somewhere.com

Is there a curl command can do like

curl -X POST -H "Content-Type: plain/text" --data-binary "http://somefile.com/file"  "http://somewhere.com"

suppose http://somefile.com/file is a binary text file

1 Answer 1

6

you can do the following:

curl -s http://somefile.com/file | curl --data-binary @- http://somewhere.com
1
  • 1
    removing the superfluous "-X POST" would make it even nicer =) Nov 19, 2014 at 7:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.