From 2f98ab7c763cfad098ee48575f121302f15d992b Mon Sep 17 00:00:00 2001 From: wanggaofeng <15601716045@163.com> Date: Fri, 5 Jan 2024 11:55:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HttpClientStudy.Core/SimpleHttpClient.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/HttpClientStudy.Core/SimpleHttpClient.cs b/HttpClientStudy.Core/SimpleHttpClient.cs index 30336fd..d7c33d6 100644 --- a/HttpClientStudy.Core/SimpleHttpClient.cs +++ b/HttpClientStudy.Core/SimpleHttpClient.cs @@ -11,6 +11,7 @@ namespace HttpClientStudy.Core /// </summary> public class SimpleHttpClient { + #region Get请求 public string Get(string url) { HttpClient client = new HttpClient(); @@ -31,7 +32,7 @@ namespace HttpClientStudy.Core response.EnsureSuccessStatusCode(); //或者 if (response.IsSuccessStatusCode) - { + { //业务逻辑 } @@ -42,8 +43,8 @@ namespace HttpClientStudy.Core } //请求头 - if(response is { Headers.ETag:null}) - { + if (response is { Headers.ETag: null }) + { //业务逻辑 } @@ -98,5 +99,6 @@ namespace HttpClientStudy.Core return result; } + #endregion } }