async
params => {
}
const config = {
method: params.method || "post",
url: params.url,
}
for (const { key, value } of params.query || []) {
if (!config.params) config.params = {}
config.params[key] = value
}
for (const { key, value } of params.headers || []) {
if (!config.headers) config.headers = {}
config.headers[key] = value
}
if (params.auth) {
config.auth = {
username: params.auth.username,
password: params.auth.password,
}
}
if (params.responseType) {
config.responseType = params.responseType
}
if (params.payload) config.data = params.payload
return await require("@pipedreamhq/platform").axios(this, config)