Skip to content

Commit

Permalink
隐藏不必要函数,删除下载用httpclient
Browse files Browse the repository at this point in the history
  • Loading branch information
FirmianaMarsili committed Jun 10, 2021
1 parent e63cc14 commit a22cdfe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
8 changes: 4 additions & 4 deletions picacomic/Http/Header.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -132,12 +132,12 @@ public Header(

}

public string GetUrl()
internal string GetUrl()
{
return Url;
}

public string GetParam()
internal string GetParam()
{
return param;
}
Expand All @@ -154,7 +154,7 @@ public static void SetAuthorization(string token)



public Dictionary<string, string> GetHeader()
internal Dictionary<string, string> GetHeader()
{
string time = timestamp;
string _nonce = nonce;
Expand Down
10 changes: 4 additions & 6 deletions picacomic/Http/HttpWeb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,16 @@ namespace picacomic
/// <summary>
/// 只是对HttpClient的一个简单的封装
/// </summary>
public class HttpWeb
internal class HttpWeb
{
private static HttpClient httpClient = new()
{
BaseAddress = new(Header.baseUrl),
Timeout = new TimeSpan(0, 0, 5)
};

private static HttpClient httpClientDownload = new() { Timeout = new TimeSpan(0, 0, 10) };


public static async Task <T> SendAsync<T>(Header header)
internal static async Task<T> SendAsync<T>(Header header)
{
string url = header.GetUrl();
var dic = header.GetHeader();
Expand Down Expand Up @@ -52,7 +50,7 @@ public class HttpWeb
else
{
throw new Exception($"URL: {header.GetUrl()} \n 错误信息:{Data.Message} \n {Data.Detail}");
}
}
}
}
}
}

0 comments on commit a22cdfe

Please sign in to comment.