mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-01-01 05:13:40 +01:00
Reuse httpclient, create in Util
This commit is contained in:
parent
93863dbc8a
commit
321f39dc55
7 changed files with 34 additions and 28 deletions
|
|
@ -1,4 +1,4 @@
|
|||
using System.Net.Http;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
|
@ -28,8 +28,6 @@ namespace Dalamud.Support
|
|||
if (content.IsNullOrWhitespace())
|
||||
return;
|
||||
|
||||
using var client = new HttpClient();
|
||||
|
||||
var model = new FeedbackModel
|
||||
{
|
||||
Content = content,
|
||||
|
|
@ -45,7 +43,7 @@ namespace Dalamud.Support
|
|||
}
|
||||
|
||||
var postContent = new StringContent(JsonConvert.SerializeObject(model), Encoding.UTF8, "application/json");
|
||||
var response = await client.PostAsync(BugBaitUrl, postContent);
|
||||
var response = await Util.HttpClient.PostAsync(BugBaitUrl, postContent);
|
||||
|
||||
response.EnsureSuccessStatusCode();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue