# Method Protocols.HTTP.Query()->set_callbacks()

Method set_callbacks

  ``Protocols.HTTP.Query` set_callbacks(`function`(:`void`) `request_ok`, `function`(:`void`) `request_fail`, `mixed` ... `extra`)`
  ``Protocols.HTTP.Query` async_request(`string` `server`, `int` `port`, `string` `query`)`
  ``Protocols.HTTP.Query` async_request(`string` `server`, `int` `port`, `string` `query`, `mapping` `headers`, `string`|`void` `data`)`

Description

  Setup and run an asynchronous request, otherwise similar to thread_request().

  `request_ok`(Protocols.HTTP.Query httpquery,...extra args) will be called when connection is complete, and headers are parsed.

  `request_fail`(Protocols.HTTP.Query httpquery,...extra args) is called if the connection fails.

Returns

  Returns the called object