2

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 

1 Answer 1

4

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.

Sign up to request clarification or add additional context in comments.

1 Comment

I know that. But I also know that curl only allows you to custom the request headers with -H and not "raw", hence my suggestion! =)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.