sendHTTPRequest

Sends an HTTP request and returns the response.

As an optimisation, constructs an HTTPRequest object and sends it to the Querier as an aggregate, instead of sending the individual parameters. (This blows up compilation memory usage otherwise.)

sendHTTPRequest
(,
const string url
,
const string caller = __FUNCTION__
,
const string authorisationHeader = string.init
,
const string clientID = string.init
,
const bool verifyPeer = true
,
shared string[string] customHeaders = null
,,
const ubyte[] body = null
,
const string contentType = string.init
,
int id = 0
,
const bool recursing = false
)

Parameters

plugin IRCPlugin

The plugin that is sending the request.

url string

The URL to send the request to.

caller string

The name of the function that called this function.

authorisationHeader string

Optional authorisation header to use.

clientID string

Optional client ID to use.

verifyPeer bool

Optionally whether to verify the peer.

customHeaders string[string]

Optional custom headers to send.

verb HTTPVerb

Optionally the HTTP verb to use.

body ubyte[]

Optional body to send.

contentType string

Optional content type to use.

id int

The unique ID of the request.

recursing bool

Whether this is a recursive call.

Return Value

Type: auto

The response to the request.

Throws

HTTPQueryException if an unspecific error occurs.

See Also