nodeunit-httpclient
nodeunit-httpclient copied to clipboard
Support request headers
Some APIs use the accept
header to negotiate the correct version to serve but it doesn't appear to be possible to set this during instantiation. Furthermore, nodeunit-httpclient assumes that if the data for a request is an object the content-type
header should be application/json
and not necessarily whatever the Accept
header is set to. This PR allows the client to be instantiated with an appropriate content-type
request header and prevents overriding the header with application/json
if it has already been set.
I don't really use this module any more but if you can merge in the latest changes from master (from your other PR) then I'll merge this in. Thanks!