You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
321 B
13 lines
321 B
module.exports = getResponse
|
|
function getResponse (opt, resp) {
|
|
if (!resp) return null
|
|
return {
|
|
statusCode: resp.statusCode,
|
|
headers: resp.headers,
|
|
method: opt.method,
|
|
url: opt.url,
|
|
// the XHR object in browser, http response in Node
|
|
rawRequest: resp.rawRequest ? resp.rawRequest : resp
|
|
}
|
|
}
|