C# 클래스 PocketCampus.Main.Services.HttpClient

An HTTP client able to make GET and POST requests.
상속: IHttpClient
파일 보기 프로젝트 열기: accandme/pocketcampus

공개 메소드들

메소드 설명
DownloadAsync ( string url ) : Task

Asynchronously downloads a file as a byte array from the specified URL.

GetAsync ( string url, string>.IDictionary parameters = null, Encoding encoding = null ) : Task

Asynchronously gets a web page (using a GET query).

PostAsync ( string url, string>.IDictionary parameters, Encoding encoding = null ) : Task

Asynchronously posts the specified query to the specified URL (using a POST query).

비공개 메소드들

메소드 설명
GetParametersString ( string>.IDictionary parameters ) : string

Transforms GET parameters into a string.

HttpClient ( ) : System

Initializes static members of HttpClient.

ProcessResponseAsync ( HttpResponseMessage response, Encoding encoding ) : Task

Asynchronously processes an HTTP response message, ensuring it was successful and extracting its content.

메소드 상세

DownloadAsync() 공개 메소드

Asynchronously downloads a file as a byte array from the specified URL.
public DownloadAsync ( string url ) : Task
url string
리턴 Task

GetAsync() 공개 메소드

Asynchronously gets a web page (using a GET query).
public GetAsync ( string url, string>.IDictionary parameters = null, Encoding encoding = null ) : Task
url string The web page URL.
parameters string>.IDictionary Optional. The query parameters.
encoding System.Text.Encoding
리턴 Task

PostAsync() 공개 메소드

Asynchronously posts the specified query to the specified URL (using a POST query).
public PostAsync ( string url, string>.IDictionary parameters, Encoding encoding = null ) : Task
url string The query URL.
parameters string>.IDictionary The query parameters.
encoding System.Text.Encoding
리턴 Task