Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function executeRequest ({
name, id = guid(), method, address, data, headers, options, pre, auth, post
}) {
try {
enterRequest(name, id, method, address, data, headers)
executePrerequest(postman[Pre], pre)
const config = makeRequestConfig(method, address, data, headers, options)
if (auth) {
auth(config, Var)
}
const args = makeRequestArgs(config)
const response = http.request(...args)
if (post) {
enterPost(response)
executePostrequest(postman[Post], post, response)
executeTests()
}
return response
} finally {
exitRequest()
}
}
function namedRequest (name, index = 1) {