From a22cdfe5825771613c7812fcb7d70de6bb8a593c Mon Sep 17 00:00:00 2001 From: FirmianaMarsili <804112469@qq.com> Date: Thu, 10 Jun 2021 11:30:02 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9A=90=E8=97=8F=E4=B8=8D=E5=BF=85=E8=A6=81?= =?UTF-8?q?=E5=87=BD=E6=95=B0,=E5=88=A0=E9=99=A4=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E7=94=A8httpclient?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- picacomic/Http/Header.cs | 8 ++++---- picacomic/Http/HttpWeb.cs | 10 ++++------ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/picacomic/Http/Header.cs b/picacomic/Http/Header.cs index 0859706..8442477 100644 --- a/picacomic/Http/Header.cs +++ b/picacomic/Http/Header.cs @@ -30,7 +30,7 @@ public class Header - public static readonly string baseUrl = "https://picaapi.picacomic.com/"; + internal static readonly string baseUrl = "https://picaapi.picacomic.com/"; private readonly string api_key = "C69BAF41DA5ABD1FFEDC6D2FEA56B"; @@ -132,12 +132,12 @@ public Header( } - public string GetUrl() + internal string GetUrl() { return Url; } - public string GetParam() + internal string GetParam() { return param; } @@ -154,7 +154,7 @@ public static void SetAuthorization(string token) - public Dictionary GetHeader() + internal Dictionary GetHeader() { string time = timestamp; string _nonce = nonce; diff --git a/picacomic/Http/HttpWeb.cs b/picacomic/Http/HttpWeb.cs index 82bd1cf..5fc18ff 100644 --- a/picacomic/Http/HttpWeb.cs +++ b/picacomic/Http/HttpWeb.cs @@ -9,7 +9,7 @@ namespace picacomic /// /// 只是对HttpClient的一个简单的封装 /// - public class HttpWeb + internal class HttpWeb { private static HttpClient httpClient = new() { @@ -17,10 +17,8 @@ public class HttpWeb Timeout = new TimeSpan(0, 0, 5) }; - private static HttpClient httpClientDownload = new() { Timeout = new TimeSpan(0, 0, 10) }; - - public static async Task SendAsync(Header header) + internal static async Task SendAsync(Header header) { string url = header.GetUrl(); var dic = header.GetHeader(); @@ -52,7 +50,7 @@ public class HttpWeb else { throw new Exception($"URL: {header.GetUrl()} \n 错误信息:{Data.Message} \n {Data.Detail}"); - } - } + } + } } }