BobSwanson
BobSwanson

Reputation: 423

Post string value to Web Api

I'm trying to post to Web Api Values controller via post:

// POST api/values
public void Post([FromBody]string value)
{
}

but the value is always null.

I'm using Postman to post this in body: {"test"} set as Json(application/json)

Upvotes: 0

Views: 901

Answers (1)

BobSwanson
BobSwanson

Reputation: 423

Sending simply "test" in quotes did the trick.

Upvotes: 1

Related Questions