节点从axios发布接收发布json [英] Node receive post json from axios post

查看:61
本文介绍了节点从axios发布接收发布json的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有2个不同的url,第一个从html页面接收带有数据的表单动作,并向第二个url发出发布请求.这将接收json并通过express对此json进行get请求.

I have 2 different url, the first one receive a form action from an html page with the data and make a post request to the second url. This receive the json and with express make a get request with this json.

我如何读取通过axios发出的带有发布请求的其他网址中接收到的json?

How can I read a json that I receive from another url with post request made with axios?

谢谢

推荐答案

通常,Axios响应返回一个包含 data ;

Usually, Axios response returns an object containing data;

const {data: json} = await axios.post(/*details*/);
console.log(json);

这篇关于节点从axios发布接收发布json的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆