C# Класс AutoWPApi.AutoWP.HttpHelper

Utility class for simplify http parsing
Показать файл Открыть проект

Открытые методы

Метод Описание
ExecuteRequest ( string url, string contentType, string method, string body, Header optionalHeaders, bool autoRedirect ) : HttpWebResponse

Performs a HTTP request

ExtractValue ( string data, string from, string to ) : string

Extract text value between the two provided strings

ParseCookie ( string cookie ) : string
ReadBody ( HttpWebResponse response ) : byte[]

Read received body

ReadBody ( HttpWebResponse response, System encoding ) : string

Read received body

Save2disk ( string filename, byte data ) : void

Описание методов

ExecuteRequest() публичный статический Метод

Performs a HTTP request
public static ExecuteRequest ( string url, string contentType, string method, string body, Header optionalHeaders, bool autoRedirect ) : HttpWebResponse
url string Target URL
contentType string Content-Type Header
method string HTTP Method (POST/GET)
body string string data to send when method is POST
optionalHeaders Header Array of optional headers needed by the request
autoRedirect bool Allows automatically performig autoredirect when the server invokes it
Результат System.Net.HttpWebResponse

ExtractValue() публичный статический Метод

Extract text value between the two provided strings
public static ExtractValue ( string data, string from, string to ) : string
data string source string
from string Start string chunk
to string End string chunk
Результат string

ParseCookie() публичный статический Метод

public static ParseCookie ( string cookie ) : string
cookie string
Результат string

ReadBody() публичный статический Метод

Read received body
public static ReadBody ( HttpWebResponse response ) : byte[]
response System.Net.HttpWebResponse Http response received from the server
Результат byte[]

ReadBody() публичный статический Метод

Read received body
public static ReadBody ( HttpWebResponse response, System encoding ) : string
response System.Net.HttpWebResponse Http response received from the server
encoding System Content-Encoding used to decode the buffer
Результат string

Save2disk() публичный статический Метод

public static Save2disk ( string filename, byte data ) : void
filename string
data byte
Результат void