pleroma: nitpicks

This commit is contained in:
uwaa 2024-12-16 03:54:10 +00:00
parent f29cea2d55
commit fa56e8cb80

View file

@ -35,21 +35,16 @@ public class Pleroma
}
/// <summary>
/// The user agent string.
/// </summary>
public string UserAgent = "Uwaa.Pleroma/0.0";
public HttpClient HttpClient;
public Pleroma(string host, string? authorization)
public Pleroma(string host, string? authorization, string? userAgent = "Uwaa.Pleroma/0.0")
{
UriBuilder builder = new UriBuilder();
builder.Scheme = "https";
builder.Host = host;
HttpClient = new HttpClient();
HttpClient.DefaultRequestHeaders.Add("User-agent", UserAgent);
HttpClient.DefaultRequestHeaders.Add("User-agent", userAgent);
HttpClient.BaseAddress = builder.Uri;
HttpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
if (authorization != null)
@ -249,6 +244,7 @@ public class Pleroma
/// </summary>
public Task Delete(string status_id)
{
//TODO: Test
return Retry<object?>(new HttpRequestMessage(HttpMethod.Delete, $"/api/v1/statuses/{status_id}"));
}