update quality
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System.Diagnostics;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace S8n.Components.Basics;
|
||||
|
||||
@@ -30,7 +31,7 @@ public class HttpRequest
|
||||
return "http://" + url;
|
||||
}
|
||||
|
||||
public object Execute(string method, string url, Dictionary<string, string>? headers = null, object? body = null)
|
||||
public async Task<object> Execute(string method, string url, Dictionary<string, string>? headers = null, object? body = null)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(url))
|
||||
{
|
||||
@@ -77,11 +78,11 @@ public class HttpRequest
|
||||
}
|
||||
|
||||
// Execute request
|
||||
using var response = _httpClient.SendAsync(request).GetAwaiter().GetResult();
|
||||
using var response = await _httpClient.SendAsync(request);
|
||||
stopwatch.Stop();
|
||||
|
||||
// Read response content
|
||||
var responseContent = response.Content.ReadAsStringAsync().GetAwaiter().GetResult();
|
||||
var responseContent = await response.Content.ReadAsStringAsync();
|
||||
|
||||
// Extract response headers
|
||||
var responseHeaders = new Dictionary<string, string>();
|
||||
|
||||
Reference in New Issue
Block a user