I am unable to work out how to post a string array to my APIController
I want to be able to send the following JSON string:
{"userName":"un","userPassword":"password"}
This is my Controller:
public class CheckAuthenticationController : ApiController
{
public object Post(string[] stuff)
{
try
{
return GeneralFunctions.CheckAuthentication(stuff[0].ToString(), stuff[0].ToString());
}
catch
{
throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.NoContent));
}
}
}
This what my post looks like in fiddler:
POST https://localhost:8081/CheckAuthentication HTTP/1.1
User-Agent: Fiddler
Content-Type: application/json
Host: localhost:8081
Content-Length: 43
{"userName":"un","userPassword":"password"}
But when I debug, "stuff" is always null.
Can anyone help please?