Skip to content

Instantly share code, notes, and snippets.

@tmenier
Created September 10, 2018 14:24
Show Gist options
  • Save tmenier/3417dcdf6ef0dfc6d0480ae778065b72 to your computer and use it in GitHub Desktop.
Save tmenier/3417dcdf6ef0dfc6d0480ae778065b72 to your computer and use it in GitHub Desktop.
[Test]
public async Task StackOverflowQuestion() {
var message = "";
try {
var cli = new FlurlClient("https://www.google.com").EnableCookies();
var s = await cli.Request().GetStringAsync();
var result = await cli.Request("foo").PostUrlEncodedAsync(new { x = "x" });
}
catch (FlurlHttpException ex) {
message = ex.Message;
}
Assert.AreEqual("Call failed with status code 404 (Not Found): POST https://www.google.com/foo", message);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment