Send JSON from AngularJS to ASP.Net Core
I found that is anulgarjs and ASP.net Core are working very well together!
In the client side:
var Item = {};
Item.Id = 1;
Item.Name = "Test";
$http.post('/Items/Create', Item);
In the server side controller, then the JSON object can automatic parsed.
You just need to use [FromBody], I found without that, the parameter object will be always null. I think you need to tell the MVC, where is the JSON content:
[HttpPost]
[Authorize]
public async Task
That's easy and clean!
Trackback address for this post
Trackback URL (right click and copy shortcut/link location)
Feedback awaiting moderation
This post has 8 feedbacks awaiting moderation...
Form is loading...