Skip to content

Support for the Content-Type request header.#15

Open
biztos wants to merge 2 commits intocmpxchg16:masterfrom
biztos:master
Open

Support for the Content-Type request header.#15
biztos wants to merge 2 commits intocmpxchg16:masterfrom
biztos:master

Conversation

@biztos
Copy link

@biztos biztos commented Sep 29, 2015

Hi there! I was trying out gobench and my target server was rejecting POST requests due to a bad Content-Type request header. This was trivial to fix so I forked and added that support. Please consider merging this in, as I am sure there are others who would need this feature.

Added -type option for Content-Type with default.

When load-testing with POST requests, the server often cares what the content
type is, i.e it needs a Content-Type header in the request. This change adds
the option to set that explicitly with the -type flag, which you might use
for testing raw JSON payloads as well as file uploads; and a sane default if
there is POST data to send:

    Content-Type: application/x-www-form-urlencoded
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant