in src/providers/http.ts [184:209]
export async function doRequest(req: Request): Promise<Response> {
const url = req.toRequestURL();
let body;
if (req.bodyForm && Object.keys(req.bodyForm).length > 0) {
body = querystringify(req.bodyForm);
if (!req.headers['Content-Type']) {
req.headers['Content-Type'] = 'application/x-www-form-urlencoded';
}
}
const response = await httpx.request(url, {
method: req.method,
data: body,
headers: req.headers,
readTimeout: req.readTimeout,
connectTimeout: req.connectTimeout
});
const responseBody = await httpx.read(response, '');
return Response.builder()
.withStatusCode(response.statusCode)
.withHeaders(response.headers as { [key: string]: string })
.withBody(responseBody as Buffer)
.build();
}