0

I'm testing malformed HTTP requests on OSX, but I can't workout how to make a request with a missing/malformed http version.

Curl seems to only allow valid presets (--http1.0, --http1.1, --http1)

Whats the easiest way to construct a request without "http version"?

Example:

Given the following commands create the following request lines:

Ex1.

command: curl -i http://localhost:8080/cat.jpg?v=1

request: GET cat.jpg?v=1 HTTP/1.1

Ex2.

command: curl -i http://localhost:8080/cat.jpg?v=1 --http1.0

request: GET cat.jpg?v=1 HTTP/1.0

Wanted

How could I create the following

command: ???

request: GET cat.jpg?v=1 (missing http version)

EDIT: ANSWER

curl only deals with valid requests. netcat is an alternative that has more control.

See this answer

Thanks @DanFromGermany

11
  • 1
    Please show an example of what you mean. Are you saying you want to test protocols exist? Obviously curl can not use a protocol it doesn't know about, nothing can. Commented Jul 8, 2016 at 9:43
  • 1
    @123 You don't understand the question. He wants to send WRONG data ON PURPOSE to test how his webserver would react. Commented Jul 8, 2016 at 10:00
  • 1
    Software recommendations are off-topic on Stackoverflow. You would go on softwarerecs.stackexchange.com instead. Commented Jul 8, 2016 at 10:04
  • 2
    @DanFromGermany ah right, If you just want to send data to a port use nc. Commented Jul 8, 2016 at 10:06
  • 1
    Ok. I'm loathe to remove this question though, as for someone who doesn't know CURLs limitations - its hard to workout that you need an alternative tool. I'll leave it up to the mods. Commented Jul 8, 2016 at 10:12

0

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.