mirror of
https://github.com/ppy/osu
synced 2025-01-17 11:30:52 +00:00
Update API code to use the new Add* methods on requests
This commit is contained in:
parent
d8b3f984f5
commit
cd5324f1d1
@ -390,7 +390,7 @@ namespace osu.Desktop.Deploy
|
||||
|
||||
public static void AuthenticatedBlockingPerform(this WebRequest r)
|
||||
{
|
||||
r.Headers.Add("Authorization", $"token {GitHubAccessToken}");
|
||||
r.AddHeader("Authorization", $"token {GitHubAccessToken}");
|
||||
r.Perform();
|
||||
}
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ namespace osu.Game.Online.API
|
||||
|
||||
WebRequest = CreateWebRequest();
|
||||
WebRequest.AllowRetryOnTimeout = false;
|
||||
WebRequest.Headers[@"Authorization"] = $@"Bearer {api.AccessToken}";
|
||||
WebRequest.AddHeader("Authorization", $"Bearer {api.AccessToken}");
|
||||
|
||||
if (checkAndProcessFailure())
|
||||
return;
|
||||
|
@ -127,7 +127,8 @@ namespace osu.Game.Online.API
|
||||
|
||||
protected override void PrePerform()
|
||||
{
|
||||
Parameters[@"refresh_token"] = RefreshToken;
|
||||
AddParameter("refresh_token", RefreshToken);
|
||||
|
||||
base.PrePerform();
|
||||
}
|
||||
}
|
||||
@ -146,8 +147,9 @@ namespace osu.Game.Online.API
|
||||
|
||||
protected override void PrePerform()
|
||||
{
|
||||
Parameters[@"username"] = Username;
|
||||
Parameters[@"password"] = Password;
|
||||
AddParameter("username", Username);
|
||||
AddParameter("password", Password);
|
||||
|
||||
base.PrePerform();
|
||||
}
|
||||
}
|
||||
@ -161,9 +163,10 @@ namespace osu.Game.Online.API
|
||||
|
||||
protected override void PrePerform()
|
||||
{
|
||||
Parameters[@"grant_type"] = GrantType;
|
||||
Parameters[@"client_id"] = ClientId;
|
||||
Parameters[@"client_secret"] = ClientSecret;
|
||||
AddParameter("grant_type", GrantType);
|
||||
AddParameter("client_id", ClientId);
|
||||
AddParameter("client_secret", ClientSecret);
|
||||
|
||||
base.PrePerform();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user