Update utils.js
This commit is contained in:
parent
bc00fd5adf
commit
10154f2508
11
src/utils.js
11
src/utils.js
|
@ -8,6 +8,7 @@ const convert = require('xml-js')
|
|||
const { merge } = require('lodash')
|
||||
const dayjs = require('dayjs')
|
||||
const utc = require('dayjs/plugin/utc')
|
||||
const { CurlGenerator } = require('curl-generator')
|
||||
dayjs.extend(utc)
|
||||
axiosCookieJarSupport(axios)
|
||||
|
||||
|
@ -208,6 +209,16 @@ utils.buildRequest = async function (item, config) {
|
|||
console.log('Request:', JSON.stringify(request, null, 2))
|
||||
}
|
||||
|
||||
if (config.curl) {
|
||||
const curl = CurlGenerator({
|
||||
url: request.url,
|
||||
method: request.method,
|
||||
headers: request.headers,
|
||||
body: request.data
|
||||
})
|
||||
console.log(curl)
|
||||
}
|
||||
|
||||
return request
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue