I need to send an OPTIONS
request. How to I construct the client when using Flurl?
Asked
Active
Viewed 350 times
0

Ivan-Mark Debono
- 15,500
- 29
- 132
- 263
-
looks like the `OPTIONS` verb is not supported, but could be implemented as an extension. Currently supported are "Get", "Post", "Head", "Put", and "Patch" ([source](https://github.com/tmenier/Flurl/blob/a025bf274b706bbb6bb080c721e0fd4143b9561a/src/Flurl.Http.CodeGen/ExtensionMethodModel.cs)) – Cee McSharpface Sep 28 '17 at 10:40
1 Answers
0
Use SendAsync
to specify a verb that isn't directly supported:
"http://myapi.com".SendAsync(System.Net.Http.HttpMethod.Options);
If you need to send content (not likely relevant for OPTIONS), there's an optional HttpContent
arg, and there are SendJsonAsync
, SendStringAsync
, and SendUrlEncodedAsync
extensions to make that easier.

Todd Menier
- 37,557
- 17
- 150
- 173