Chilkat C# HttpResponse Class Reference

HttpResponse

Represents a complete HTTP response.

Properties

public Byte __gc[] Body {get; }

The response body returned as a byte array.

public string BodyStr {get; }

The response body returned as a string.

public string Charset {get; }

The response charset, such as "iso-8859-1", if applicable. Obviously, responses for GIF and JPG files will not have a charset.

public int ContentLength {get; }

The content length of the response, in bytes.

public DateTime Date {get; }

The Date response header field, returned in an easy-to-use date/time data type.

public string Domain {get; }

The domain of the HTTP server that created this response.

public string Header {get; }

The full text of the response header.

public int NumCookies {get; }

The number of cookies included in the response.

public int NumHeaderFields {get; }

The number of response header fields.

public int StatusCode {get; }

The status code (as an integer) from the first line of an HTTP response. If the StatusLine = "HTTP/1.0 200 OK", the response status code returned is 200.

public string StatusLine {get; }

The first line of an HTTP response, such as "HTTP/1.0 200 OK".

Methods

public string GetCookieDomain(int index);

Returns the domain of the Nth cookie in the response. Indexing begins at 0. The number of response cookies is specified in the NumCookies property.

Returns a null on failure

public DateTime GetCookieExpires(int index);

Returns the expiration date/time of the Nth cookie in the response. Indexing begins at 0. The number of response cookies is specified in the NumCookies property.

public string GetCookieExpiresStr(int index);

Returns the expiration date/time of the Nth cookie in the response. Indexing begins at 0. The number of response cookies is specified in the NumCookies property.

Returns a null on failure

public string GetCookieName(int index);

Returns the name of the Nth cookie returned in the response. Indexing begins at 0. The number of response cookies is specified in the NumCookies property.

Returns a null on failure

public string GetCookiePath(int index);

Returns the path of the Nth cookie returned in the response. Indexing begins at 0. The number of response cookies is specified in the NumCookies property.

Returns a null on failure

public string GetCookieValue(int index);

Returns the value of the Nth cookie returned in the response. Indexing begins at 0. The number of response cookies is specified in the NumCookies property.

Returns a null on failure

public string GetHeaderField(string fieldName);

Returns the value of a response header field accessed by field name.

Returns a null on failure

public string GetHeaderFieldAttr(string fieldName, string attrName);

Returns a response header field attribute. As an example, the response charset is simply the GetHeaderFieldAttr("content-type","charset")

Returns a null on failure

public string GetHeaderName(int index);

Gets the name of the Nth response header field. Indexing begins at 0. The number of response headers is specified by the NumHeaderFields property.

Returns a null on failure

public string GetHeaderValue(int index);

Gets the value of the Nth response header field. Indexing begins at 0. The number of response headers is specified by the NumHeaderFields property.

Returns a null on failure