Closed chrisdot closed 11 years ago
See here for web api web host workarounds: https://github.com/mccalltd/AttributeRouting/issues/96
So this should work:
[POST("Resource"), HttpPost]
public HttpResponseMessage CreateResource([FromBody] string s)
{
// Simple parameters are assumed to come from the URL by default. So use [FromBody]
}
or this:
[POST("Resource")]
public HttpResponseMessage PostCreateResource([FromBody] string s)
{
// Again, Simple parameters are assumed to come from the URL by default. So use [FromBody]
}
OK, sorry, didn't know that [FromBody] attribute
posting to web api is silly
Hello,
First of all thanks for the good job ! Keep it up !
However, here is my problem:
It's impossible to reach a POST Uri, where the content/payload is a simple string.
But if I slightly modify that to (just wrapping the string in a DTO) :
Then it works, but is frustrating. (I'm using JSON as transport format)
Is that a bug or a feature? Christophe