pleroma: nitpicks
This commit is contained in:
parent
f29cea2d55
commit
fa56e8cb80
1 changed files with 3 additions and 7 deletions
|
@ -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}"));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue