Jé Queue
Jé Queue

Reputation: 10637

Curl GET/POST raw data inclusive of headers?

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

Answers (1)

Daniel Stenberg
Daniel Stenberg

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

Related Questions