C# Class SMS20Api.SMS20.HttpHelper

Utility class for simplify http parsing
Afficher le fichier Open project: ForjaOMF/OMF-WinMobileSDK

Méthodes publiques

Méthode Description
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

ReadBodyAsXml ( HttpWebResponse response ) : XmlDocument
Save2disk ( string filename, byte data ) : void

Method Details

ExecuteRequest() public static méthode

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
Résultat System.Net.HttpWebResponse

ExtractValue() public static méthode

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
Résultat string

ParseCookie() public static méthode

public static ParseCookie ( string cookie ) : string
cookie string
Résultat string

ReadBody() public static méthode

Read received body
public static ReadBody ( HttpWebResponse response ) : byte[]
response System.Net.HttpWebResponse Http response received from the server
Résultat byte[]

ReadBody() public static méthode

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
Résultat string

ReadBodyAsXml() public static méthode

public static ReadBodyAsXml ( HttpWebResponse response ) : XmlDocument
response System.Net.HttpWebResponse
Résultat System.Xml.XmlDocument

Save2disk() public static méthode

public static Save2disk ( string filename, byte data ) : void
filename string
data byte
Résultat void