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
Sign up to request clarification or add additional context in comments.

1 Comment

removing the superfluous "-X POST" would make it even nicer =)

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.