Request Callback

RequestCB

Example: Asynchronous ConversationsAsynchronous Functions - C

Called before a request is sent.

WEB_ASYNC_CB_RC_ENUM <function name>(void);

Return Values

Returns a value of WEB_ASYNC_CB_RC_ENUM

General Information

A request callback is a user-created function. It is invoked once during the creation of each TaskClosed A web task consists of an HTTP request and any directly related HTTP responses and requests until the eventual HTTP response to the initial HTTP request. Redirections are not included in an RDR. within the ConversationClosed An Asynchronous Conversation is a series of related web tasks, including tasks caused by redirection. An Asynchronous Conversation starts with the request for the desired response, includes all the requests and responses that are caused by this request (authentication, redirection, and so on) and ends when the desired response is received or when the series of interactions is canceled.. The function is called before any network processing, for example, resolve DNS, connect, and so on.

Examples of the use of a task Initialization callback:

  • Modifying a request's URL
  • Modifying a request's request body.

An example of where these modifications may be required is repetitive Asynchronous Conversation Patterns where each request should have a different index or timestamp. See Asynchronous Conversation PatternClosed A Pattern consists of one or more web tasks, issued and responded-to according to a predefined pattern, such as push, poll, or long poll. A Repetitive Pattern consists of more than one Conversation. For example, polling.

This callback can invoke these web utility functions:

C Language

Java Language

It can also call any of the general utility functions. See Utility Functions: C Language (lr_) or Utility Functions: JavaScript Language (lr.).

Concept Link IconSee Also