Update utils.js

This commit is contained in:
Aleksandr Statciuk 2022-03-06 16:18:08 +03:00
parent bc00fd5adf
commit 10154f2508
1 changed files with 11 additions and 0 deletions

View File

@ -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
}