无法使用postman投递到快递app

编程入门 行业动态 更新时间:2024-10-04 19:28:16

无法使用postman投递到<a href=https://www.elefans.com/category/jswz/34/1771386.html style=快递app"/>

无法使用postman投递到快递app

我的节点应用程序中有以下代码:

// POST route
app.post('/bb', async (req, res) => {
    try {
        // Assuming you're receiving JSON data in the request body
        const newData = await req;
        // Process the new data here
        console.log('Received new data:', newData);
        res.status(200).json({ message: 'Data received successfully' });
    } catch (err) {
        res.status(500).json({ error: err.message });
    }
});

app.listen(3000, () => console.log('Server started on port 3000'));

当我尝试用 Postman 向它发送一些 json 时,我得到:

Cannot POST /bb%0A

我做错了什么?

回答如下:

我在邮递员的最后一个网址

http://localhost:3000/bb[arrow]
看到箭头,所以你可以删除那个箭头再试一次。

更多推荐

无法使用postman投递到快递app

本文发布于:2024-05-30 19:42:44,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1770850.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:快递   postman   app

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!