axiosの要求pythonサービスの使用では、問題が発生した、axiosは、pythonの戻り値を取得することができませんでした読んだ後、解決策は次のとおりです。
self.send_response(200)
self.send_header('Content-Type', 'application/json')
self.end_headers()
self.wfile.write(json.dumps(resp).encode("utf-8"))
アクシオスで受け取る場合
async function (step, callback, ctx) {
ctx.set(step.parameters.rename, await python_exec(data));
}
ここで python_exec は実際のリクエスト部分です。
return axios({
method: 'post',
url:url,
data: data,
headers: headers
})
.then(function(response) {
return response.data.content;
})
.catch(function (error) {
console.log(error);
});
実際の戻り値は、async、await、returnを使用して取得できます。