Skip to content

Commit

Permalink
Use the raw data of the delivery body. (Closes: #136)
Browse files Browse the repository at this point in the history
  • Loading branch information
fourdollars committed Jun 6, 2020
1 parent d2381e9 commit d32f75c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,19 @@ class Client {

const target = url.parse(this.target, true)
const mergedQuery = Object.assign(target.query, data.query)
var req = undefined
target.search = querystring.stringify(mergedQuery)

delete data.query

const req = superagent.post(target).send(data.body)

delete data.body
if ("rawdata" in data) {
delete data.body
req = superagent.post(target).send(data.rawdata)
delete data.rawdata
} else {
req = superagent.post(target).send(data.body)
delete data.body
}

Object.keys(data).forEach(key => {
req.set(key, data[key])
Expand Down

0 comments on commit d32f75c

Please sign in to comment.