How to receive json in ASP.NET web api?

后端 未结 3 1468
北海茫月
北海茫月 2020-12-18 08:51

I have an external company pushing data to one of our server, they are going to send JSON data. I need to create a POST api to receive it. This is what I have so far

3条回答
  •  我在风中等你
    2020-12-18 09:34

    Have you tried JSON.stringify(yourObject) (this is Javascript but any language has this kind of utility) before passing it to your web api?

    May I also point out your comment earlier, stating you're using a GET method because you can't get POST working? You should be careful in your planning because a GET method can only take so much space: if your object becomes larger you'll be forced to use a POST, so I'd suggest you take this approach right away.

提交回复
热议问题