HTTP::Client

This is the HTTP::Client class version 1.0.

Represents an HTTP user agent.

Initializer

$client = Client()

Creates a new Client class instance.

  • optional userAgent: Str - HTTP user agent. Default is "ferret-http/<version>".

  • optional timeout: Num - Request timeout. Set to undefined for no timeout.

  • optional maxContentLength: Num - Maximum length of content. If reached, the connection will be closed and the response will be truncated to this length. By default, there is no limit.

  • optional readLength: Num - Read length in bytes. Default is 64 KB.

  • optional writeLength: Num - Write length in bytes. Default is 64 KB.

Methods

get

$client.get($url: Str)

Convenient method for a GET request. See the request method.

  • url: Str - HTTP URL to request.

post

$client.post($url: Str)

Convenient method for a POST request. See the request method.

  • url: Str - HTTP URL to request.

request

$client.request($httpMethod: Method, $url: Str)

Creates an HTTP::Request.

  • httpMethod: Method - Request HTTP method.

  • url: Str - HTTP URL to request.

End of the HTTP::Client class.

This file was generated automatically by the Ferret compiler from Client.frt.