HttpRequest

From Pointui

AVAILABLE SINCE: 2.0.22b

Provides much greater control over the HTTP request that is sent with the HttpFetch class.

Contents

Methods

void SetUrl(String url)

Specifies the url for the request. A url must always be specified for the HttpRequest to be valid.

void SetContentType(String contentType)

Specifies the content type string to include in the HTTP header of the request.

void AddHeader(String name, String value)

Adds a name/value pair to the request header.

void AddBasicAuthHeader(String name, String password)

Adds an "Authorization" line to the request header that includes the name and password encoded for basic authentication.

void SetContent(String content)

void SetContent(ByteArray content)

Sets the content data for the request. If the content is a String then it's converted to UTF8. If it's a ByteArray then the content is set from the data contained within the ByteArray. It is not necessary to include a Content-Length header when setting custom content - this is automatically included, although you can manually provide it as well.

void SetAutoRedirect(bool autoRedirect)

Specifies whether the HttpFetch object should automatically go and download the url returned in the "location" header when the originally requested url resulted in a 301, 302, 303, or 307 response code. By default this is enabled.