Two APIs I've been working with lately, Remember the Milk and Trello, both expect you to include the API key and user token as query string parameters for POSTs, and then include your data in the request body as JSON.
Unless I'm missing something, RestSharp doesn't seem to support this right now, so I'm having to do something like this:
var client = new RestClient(baseUrl);
var request = new RestRequest("{version}/cards?key={key}&token={token}", Method.POST) { RequestFormat = DataFormat.Json };
request.AddUrlSegment("version", "1")
.AddUrlSegment("key", key)
.AddUrlSegment("token", token)
.AddBody(card);
If I don't do it this way, the key and token get added to the body as post data, wiping out the JSON. My solution seems clumsy, though.
Would you consider accepting a feature to allow parameters to be explicitly placed in the query string during POST requests, instead of always encoding them in the body? Something like this:
request.AddUrlSegment("version", "1")
.AddParameter("key", key, ParameterType.QueryString)
.AddUrlSegment("token", token, ParameterType.QueryString)
.AddBody(card);
If so, I'll work on a pull request.