Skip to content

Instantly share code, notes, and snippets.

@Imater
Created November 27, 2014 08:14
Show Gist options
  • Save Imater/3a0e80eccba18c564251 to your computer and use it in GitHub Desktop.
Save Imater/3a0e80eccba18c564251 to your computer and use it in GitHub Desktop.
public List<TModel> Post<TModel>(string url, object bodyObject) where TModel : new()
{
var request = new RestRequest(url, Method.POST)
{
RequestFormat = DataFormat.Json
};
request.AddBody(bodyObject);
IRestResponse<List<TModel>> response = _client.Execute<List<TModel>>(request);
CheckResponseFailed(response);
return response.Data;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment