贴一下我的测试代码,供大家参考,也欢迎指正:
if ($request.method === 'GET' && $request.headers['Content-Length'] != '0') {
$httpClient.post({
url: $request.url,
headers: $request.headers,
body: $request.body,
}, (error, response, data) => {
$done({
status: response.status,
headers: response.headers,
body: data,
})
})
} else {
$done({})
}