Reputation: 10637
Is there a way in command-line curl
to POST or GET (insert your favorite HTTP method) data to a URL and include in the raw posted data header values instead of issuing the -H
options?
For instance:
$curl --data-binary @- http://server.com/foo/bar <<EOF
X-Foo: Foo
X-Bar: Bar and a lot of random characters
Accept-Encoding: bzip2
My-raw-binary-data-here...
EOF
Upvotes: 2
Views: 1984
Reputation: 58084
no, there's no way. curl is a HTTP client that does the HTTP for you. Use 'nc' (netcat) or similar if you want to craft your full request more freely.
Upvotes: 4