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

Alexander Farber
  • 21,519
  • 75
  • 241
  • 416
user3873113
  • 27
  • 1
  • 8

1 Answers1

6

you can do the following:

curl -s http://somefile.com/file | curl --data-binary @- http://somewhere.com
Hans Z.
  • 50,496
  • 12
  • 102
  • 115