diff options
Diffstat (limited to 'Gestor.Common/Gestor.Common.Helpers/HttpHelper.cs')
| -rw-r--r-- | Gestor.Common/Gestor.Common.Helpers/HttpHelper.cs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Gestor.Common/Gestor.Common.Helpers/HttpHelper.cs b/Gestor.Common/Gestor.Common.Helpers/HttpHelper.cs new file mode 100644 index 0000000..de15cd1 --- /dev/null +++ b/Gestor.Common/Gestor.Common.Helpers/HttpHelper.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Net; +using System.Net.Http; + +namespace Gestor.Common.Helpers; + +public static class HttpHelper +{ + public static HttpRequestMessage CreateRequest(this Uri requestUri, HttpMethod httpMethod, Version httpVersion = null) + { + //IL_0000: Unknown result type (might be due to invalid IL or missing references) + //IL_0005: Unknown result type (might be due to invalid IL or missing references) + //IL_0015: Unknown result type (might be due to invalid IL or missing references) + //IL_001c: Unknown result type (might be due to invalid IL or missing references) + //IL_0024: Expected O, but got Unknown + return new HttpRequestMessage + { + Version = (httpVersion ?? HttpVersion.Version11), + RequestUri = requestUri, + Method = httpMethod + }; + } + + public static FormUrlEncodedContent Encode(this List<KeyValuePair<string, string>> keyValuePairs) + { + //IL_0001: Unknown result type (might be due to invalid IL or missing references) + //IL_0007: Expected O, but got Unknown + return new FormUrlEncodedContent((IEnumerable<KeyValuePair<string, string>>)keyValuePairs); + } +} |