I have a POST method in my WebApi that takes json string as parameter.
[HttpPost]
public HttpResponseMessage GetOrderDataBySessionId([FromBody] string json)
I tried hitting it using RestClient with URL: localhost:56934/api/Home/GetOrderDataBySessionId
and specifying following json string in the Body:
{
"ListSessionId": [
"180416073256DGQR10",
"180416091511DGQR10"
]
}
setting the body/content type as application/json. But when it hits my method, the json string parameter is always null.
Is it because I need to use a complex type in parameter?
Can we never have input in string?