Skip to content

Instantly share code, notes, and snippets.

@dmigo
Created June 27, 2018 21:23
Show Gist options
  • Save dmigo/8b2affa54f4e1cc854eb122514a0058d to your computer and use it in GitHub Desktop.
Save dmigo/8b2affa54f4e1cc854eb122514a0058d to your computer and use it in GitHub Desktop.
// Flurl will use 1 HttpClient instance per host
var person = await "https://api.com"
.AppendPathSegment("person")
.SetQueryParams(new { a = 1, b = 2 })
.WithOAuthBearerToken("my_oauth_token")
.PostJsonAsync(new
{
first_name = "Claire",
last_name = "Underwood"
})
.ReceiveJson<Person>();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment