mirror of
https://github.com/ShareX/ShareX.git
synced 2024-09-30 01:07:21 +13:00
Update GitHub authorization method because previous method is deprecated
This commit is contained in:
parent
55cf449be4
commit
ba447fa171
1 changed files with 4 additions and 3 deletions
|
@ -29,6 +29,7 @@ You should have received a copy of the GNU General Public License
|
|||
using ShareX.HelpersLib;
|
||||
using ShareX.UploadersLib.Properties;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
|
@ -142,10 +143,10 @@ public override UploadResult UploadText(string text, string fileName)
|
|||
|
||||
string json = JsonConvert.SerializeObject(gistUpload);
|
||||
|
||||
Dictionary<string, string> args = new Dictionary<string, string>();
|
||||
args.Add("access_token", AuthInfo.Token.access_token);
|
||||
NameValueCollection headers = new NameValueCollection();
|
||||
headers.Add("Authorization", "token " + AuthInfo.Token.access_token);
|
||||
|
||||
string response = SendRequest(HttpMethod.POST, url, json, RequestHelpers.ContentTypeJSON, args);
|
||||
string response = SendRequest(HttpMethod.POST, url, json, RequestHelpers.ContentTypeJSON, null, headers);
|
||||
|
||||
GistResponse gistResponse = JsonConvert.DeserializeObject<GistResponse>(response);
|
||||
|
||||
|
|
Loading…
Reference in a new issue