C# Class CsQuery.Web.CsqWebRequest

A CsqWebRequest object manages data and state related to a WebRequest
Inheritance: ICsqWebRequest
Afficher le fichier Open project: prepare/HTML-Renderer Class Usage Examples

Méthodes publiques

Méthode Description
CsqWebRequest ( string url ) : System

Creates a new CsqWebRequest for a given URL using the default IHttpWebRequestFactory.

CsqWebRequest ( string url, IHttpWebRequestFactory webRequestFactory ) : System

Creates a new CsqWebRequest for a URL using the provided IHttpWebRequestFactory. (Usually, you should use the default constructor, unless replacing the .NET framework HttpWebRequest object for testing or some other purpose)

Get ( ) : string

Get the HTML using a synchronous HTTP request. This will return a string using the encoding specified by the MIME type. If the document uses an encoding specified in a content-type header, it will NOT be reflected by the results of this method.

Get ( IHttpWebRequest request ) : string

Initiate a synchronous GET request from an existing IHttpWebRequest object

GetAsync ( Action success, Action fail ) : ManualResetEvent

Initiates an asynchronous GET request.

GetAsync ( IHttpWebRequest request, Action success, Action fail ) : ManualResetEvent

Initiates an asynchronous GET request from an IHttpWebRequest object.

GetEncoding ( IHttpWebResponse response ) : Encoding

Return the character set encoding for an IHttpWebResponse, or null if no encoding is specified.

GetWebRequest ( ) : IHttpWebRequest

Gets a new HttpWebRequest object for the URL bound to this CsqWebRequest.

Post ( ) : string

Initiate an http POST request.

Post ( string url ) : string

Initiate an http POST request.

Post ( string url, string>.IEnumerable postData ) : string

Initiate an http POST request.

Méthodes protégées

Méthode Description
GetResponseStreamReader ( IHttpWebRequest request ) : StreamReader

Gets response stream from a webrequest using the correct encoding. If the encoding is not specified, then the encoding will be detected from the BOM.

Private Methods

Méthode Description
ApplyOptions ( IHttpWebRequest request ) : void

Method Details

CsqWebRequest() public méthode

Creates a new CsqWebRequest for a given URL using the default IHttpWebRequestFactory.
public CsqWebRequest ( string url ) : System
url string /// URL of the document. ///
Résultat System

CsqWebRequest() public méthode

Creates a new CsqWebRequest for a URL using the provided IHttpWebRequestFactory. (Usually, you should use the default constructor, unless replacing the .NET framework HttpWebRequest object for testing or some other purpose)
public CsqWebRequest ( string url, IHttpWebRequestFactory webRequestFactory ) : System
url string /// URL of the document. ///
webRequestFactory IHttpWebRequestFactory /// The web request factory. ///
Résultat System

Get() public méthode

Get the HTML using a synchronous HTTP request. This will return a string using the encoding specified by the MIME type. If the document uses an encoding specified in a content-type header, it will NOT be reflected by the results of this method.
public Get ( ) : string
Résultat string

Get() public méthode

Initiate a synchronous GET request from an existing IHttpWebRequest object
public Get ( IHttpWebRequest request ) : string
request IHttpWebRequest /// The request. ///
Résultat string

GetAsync() public méthode

Initiates an asynchronous GET request.
public GetAsync ( Action success, Action fail ) : ManualResetEvent
success Action /// A delegate that will be invoked with the response data structure upon successful resolution /// of the request. ///
fail Action /// A delegate that will be invoked with the response data structure upon failure. ///
Résultat System.Threading.ManualResetEvent

GetAsync() public méthode

Initiates an asynchronous GET request from an IHttpWebRequest object.
public GetAsync ( IHttpWebRequest request, Action success, Action fail ) : ManualResetEvent
request IHttpWebRequest /// The request. ///
success Action /// A delegate that will be invoked with the response data structure upon successful resolution /// of the request. ///
fail Action /// A delegate that will be invoked with the response data structure upon failure. ///
Résultat System.Threading.ManualResetEvent

GetEncoding() public static méthode

Return the character set encoding for an IHttpWebResponse, or null if no encoding is specified.
public static GetEncoding ( IHttpWebResponse response ) : Encoding
response IHttpWebResponse /// The response. ///
Résultat System.Text.Encoding

GetResponseStreamReader() protected méthode

Gets response stream from a webrequest using the correct encoding. If the encoding is not specified, then the encoding will be detected from the BOM.
protected GetResponseStreamReader ( IHttpWebRequest request ) : StreamReader
request IHttpWebRequest /// The request. ///
Résultat System.IO.StreamReader

GetWebRequest() public méthode

Gets a new HttpWebRequest object for the URL bound to this CsqWebRequest.
public GetWebRequest ( ) : IHttpWebRequest
Résultat IHttpWebRequest

Post() public méthode

Initiate an http POST request.
public Post ( ) : string
Résultat string

Post() public méthode

Initiate an http POST request.
public Post ( string url ) : string
url string /// URL of the document. ///
Résultat string

Post() public méthode

Initiate an http POST request.
public Post ( string url, string>.IEnumerable postData ) : string
url string /// URL of the document. ///
postData string>.IEnumerable /// The information describing the post data to be sent this request. ///
Résultat string