1

I'm trying to use angular and asp.net vNext Web API. I have a controller up but when using angular's $resource the object values are not resolved (Post method parameter is null)

The request itself has nothing out of the ordinary, though it does send json back. I think I've seen somewhere that vNext doesn't support content negotiation yet so maybe that's it. Can anyone confirm or shed some light on the subject?

Also - is there a way to get to the raw post data in Web API? (I'm using the core framework) cause the Request.Form that I know from mvc is not there any more. I tried the GetFormAsync but that returns an empty collection.

EDIT: Confirmed that the reason for not binding the parameter is the fact that data is sent as JSON. When form encoding is used, the parameter values are resolved correctly.

1 Answer 1

1

using [FromBody] attribute on the param solved the issue.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.