How to receive JSON in express node.js POST request?

前端 未结 2 663
心在旅途
心在旅途 2020-12-14 09:03

I send a POST WebRequest from C# along with a JSON object data and want to receive it in a Node.js server like this:

var express = require(\'exp         


        
2条回答
  •  猫巷女王i
    2020-12-14 09:29

    The request has to be sent with: content-type: "application/json; charset=utf-8"

    Otherwise the bodyParser kicks your object as a key in another object :)

提交回复
热议问题