POST string to ASP.NET Web Api application - returns null

前端 未结 7 1647
有刺的猬
有刺的猬 2020-11-28 08:05

Im trying to transmit a string from client to ASP.NET MVC4 application.

But I can not receive the string, either it is null or the post method can not be found (404

7条回答
  •  清歌不尽
    2020-11-28 08:20

    i meet this problem, and find this article. http://www.jasonwatmore.com/post/2014/04/18/Post-a-simple-string-value-from-AngularJS-to-NET-Web-API.aspx

    The solution I found was to simply wrap the string value in double quotes in your js post

    works like a charm! FYI

提交回复
热议问题