Getting BadRequest when calling POST with RestSharp
<p>Followup on my question <a href="https://stackoverflow.com/questions/41384385/getting-null-values-when-deserializing-a-list-using-restsharp">Getting null values when deserializing a list using RestSharp</a></p>

<p>I have another problem now. I need to call POST and the json body should look like this:</p>

<pre><code>{"email": {"evstatus": "processed"}}
</code></pre>

<p>My code look like this</p>

<pre><code>class Email
{
    public string Evexpire { get; set; }
    public string Evfields { get; set; }
    public string Evsysseq { get; set; }
    public string Evtime { get; set; }
    public string Evtype { get; set; }
    public string Evstatus { get; set; }
}

var client = new RestClient("xxx");
client.Authenticator = new HttpBasicAuthenticator("xx", "x");
var request = new RestRequest("xxxx/action/processed", Method.POST);
request.RequestFormat = DataFormat.Json;
request.RootElement = "email";
request.AddJsonBody(new Email  { Evstatus = "processed" }  );
</code></pre>

<p>But I receive this error:</p>

<pre><code>"StatusCode: BadRequest, Content-Type: application/json;charset=utf-8, Content-Length: 0)"
</code></pre>

<p>When I look at the request in the debugger I see this in the parameter list which apart from the fields with null values do not look like what I need.  </p>

<pre><code>{application/json={"Evexpire":null,"Evfields":null,"Evsysseq":null,"Evtime":null,"Evtype":null,"Evstatus":"processed"}}
</code></pre>

<p>What should I change/add to get this to work? (I got this request to work in SoapUI)</p>