diff options
| author | Lucas Faria Mendes <lucas.fariamo08@gmail.com> | 2026-03-30 13:38:18 +0000 |
|---|---|---|
| committer | Lucas Faria Mendes <lucas.fariamo08@gmail.com> | 2026-03-30 13:38:18 +0000 |
| commit | 1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1 (patch) | |
| tree | e1c3b20ea08f0cf71122a1e73f0d395f8fd83874 /Gestor.Application/Helpers/HttpHelper.cs | |
| parent | 674ca83ba9243a9e95a7568c797668dab6aee26a (diff) | |
| download | gestor-1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1.tar.gz gestor-1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1.zip | |
chore: location
Diffstat (limited to 'Gestor.Application/Helpers/HttpHelper.cs')
| -rw-r--r-- | Gestor.Application/Helpers/HttpHelper.cs | 103 |
1 files changed, 0 insertions, 103 deletions
diff --git a/Gestor.Application/Helpers/HttpHelper.cs b/Gestor.Application/Helpers/HttpHelper.cs deleted file mode 100644 index e042d1b..0000000 --- a/Gestor.Application/Helpers/HttpHelper.cs +++ /dev/null @@ -1,103 +0,0 @@ -using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-using System;
-using System.Collections.Generic;
-using System.Collections.Specialized;
-using System.Linq;
-using System.Net.Http;
-using System.Runtime.CompilerServices;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Gestor.Application.Helpers
-{
- public static class HttpHelper
- {
- public static Uri AddQuery<T>(this Uri uri, string name, T value)
- {
- //
- // Current member / type: System.Uri Gestor.Application.Helpers.HttpHelper::AddQuery(System.Uri,System.String,T)
- // File path: C:\AggerSeguros\Gestor.Application.exe
- //
- // Product version: 0.0.0.0
- // Exception in: System.Uri AddQuery(System.Uri,System.String,T)
- //
- // Managed pointer usage not in SSA
- // at Telerik.JustDecompiler.Steps.ManagedPointersRemovalStep.CheckForAssignment(BinaryExpression node) in D:\a\CodemerxDecompile\CodemerxDecompile\src\JustDecompileEngine\src\JustDecompiler.Shared\Steps\ManagedPointersRemovalStep.cs:line 100
- // at Telerik.JustDecompiler.Steps.ManagedPointersRemovalStep.VisitBinaryExpression(BinaryExpression node) in D:\a\CodemerxDecompile\CodemerxDecompile\src\JustDecompileEngine\src\JustDecompiler.Shared\Steps\ManagedPointersRemovalStep.cs:line 80
- // at Telerik.JustDecompiler.Ast.BaseCodeVisitor.Visit(ICodeNode node) in D:\a\CodemerxDecompile\CodemerxDecompile\src\JustDecompileEngine\src\JustDecompiler.Shared\Ast\BaseCodeVisitor.cs:line 351
- // at Telerik.JustDecompiler.Steps.ManagedPointersRemovalStep.VisitExpressions() in D:\a\CodemerxDecompile\CodemerxDecompile\src\JustDecompileEngine\src\JustDecompiler.Shared\Steps\ManagedPointersRemovalStep.cs:line 41
- // at Telerik.JustDecompiler.Steps.ManagedPointersRemovalStep.Process(DecompilationContext context, BlockStatement body) in D:\a\CodemerxDecompile\CodemerxDecompile\src\JustDecompileEngine\src\JustDecompiler.Shared\Steps\ManagedPointersRemovalStep.cs:line 29
- // at Telerik.JustDecompiler.Decompiler.DecompilationPipeline.RunInternal(MethodBody body, BlockStatement block, ILanguage language) in D:\a\CodemerxDecompile\CodemerxDecompile\src\JustDecompileEngine\src\JustDecompiler.Shared\Decompiler\DecompilationPipeline.cs:line 100
- // at Telerik.JustDecompiler.Decompiler.DecompilationPipeline.Run(MethodBody body, ILanguage language) in D:\a\CodemerxDecompile\CodemerxDecompile\src\JustDecompileEngine\src\JustDecompiler.Shared\Decompiler\DecompilationPipeline.cs:line 72
- // at Telerik.JustDecompiler.Decompiler.Extensions.Decompile(MethodBody body, ILanguage language, DecompilationContext& context, TypeSpecificContext typeContext) in D:\a\CodemerxDecompile\CodemerxDecompile\src\JustDecompileEngine\src\JustDecompiler.Shared\Decompiler\Extensions.cs:line 61
- // at Telerik.JustDecompiler.Decompiler.WriterContextServices.BaseWriterContextService.DecompileMethod(ILanguage language, MethodDefinition method, TypeSpecificContext typeContext) in D:\a\CodemerxDecompile\CodemerxDecompile\src\JustDecompileEngine\src\JustDecompiler.Shared\Decompiler\WriterContextServices\BaseWriterContextService.cs:line 133
- //
- // mailto: JustDecompilePublicFeedback@telerik.com
-
- }
-
- public static Dictionary<string, string> ParseQueryString(this Uri uri)
- {
- int num = uri.Query.IndexOf('?') + 1;
- return (
- from o in uri.Query.Substring(num).Split(new char[] { '&' })
- select o.Split(new char[] { '=' }) into items
- where (int)items.Length == 2
- select items).ToDictionary<string[], string, string>((string[] pair) => pair[0], (string[] pair) => pair[1]);
- }
-
- public static Uri SetQuery(this Uri uri, string name, string value, bool escapeValue = true)
- {
- UriBuilder uriBuilder = new UriBuilder(uri);
- Dictionary<string, string> strs = uri.ParseQueryString();
- string str = (escapeValue ? Uri.EscapeDataString(value) : value);
- if (strs.ContainsKey(name))
- {
- strs.Remove(name);
- }
- strs.Add(name, str);
- List<string> list = (
- from x in strs
- select string.Concat(x.Key, "=", x.Value)).ToList<string>();
- uriBuilder.Query = string.Join("&", list);
- return uriBuilder.Uri;
- }
-
- public static string ToBase64BasicEncode(this string value)
- {
- return string.Concat("Basic ", Convert.ToBase64String(Encoding.UTF8.GetBytes(value)));
- }
-
- public static StringContent ToHttpContent<T>(this T content, Encoding encoding = null, string mediaType = "application/json")
- {
- return new StringContent(JsonConvert.SerializeObject(content), Encoding.UTF8, mediaType);
- }
-
- public static JObject ToJObject(this string jsonString)
- {
- JObject jObject;
- try
- {
- jObject = JObject.Parse(jsonString);
- }
- catch (Exception exception)
- {
- jObject = null;
- }
- return jObject;
- }
-
- public static JObject ToJObject(this HttpContent content)
- {
- return content.ReadAsStringAsync().Result.ToJObject();
- }
-
- public static Uri ToUri(this string uri)
- {
- Uri uri1;
- Uri.TryCreate(uri, UriKind.Absolute, out uri1);
- return uri1;
- }
- }
-}
\ No newline at end of file |