# Method Protocols.HTTP.Session()->Request()->set_callbacks()

Method set_callbacks

  ``void` set_callbacks(`function`(`mixed` ... :`mixed`) `headers`, `function`(`mixed` ... :`mixed`) `data`, `function`(`mixed` ... :`mixed`) `fail`, `mixed` ... `callback_arguments`)`

Description

  Setup callbacks for async mode, `headers` will be called when the request got connected, and got data headers; `data` will be called when the request got the amount of data it's supposed to get and `fail` is called whenever the request failed.

  Note here that an error message from the server isn't considered a failure, only a failed TCP connection.