Closed diversario closed 13 years ago
Request body is still mangled at this point, I'm closing this request for now.
This can be merged for custom headers functionality, but binary attachments won't work because body is parsed into JSON object. I'll test to see if it's possible to pass body as a Buffer object.
I tried to merge but the basicTests.js file doesn't run w/ these changes. Also can you add some test cases for this?
Yeah, I'll do that.
Closing this because there's a newer one for 0.1.0 branch.
I added functionality to specify custom headers. This should be a non-breaking change.
In this version,
body
can be either JS object as it was before or an array. In case of an object all changes are just ignored and everything works as before. In case of an array, first elemens is treated asbody
and second is treated ascustomHeaders
.body
can be omitted by setting first element of the array to{}
.Examples: body only: {"name": "value"} headers only: [{}, {"Content-Type": "image/png", "Header": "Value"}] body and headers: [{"name": "value"}, {"Content-Type": "image/png", "Header": "Value"}]