ILXTransaction

new ILXTransaction(stream)

Since:
  • BIP-IP TMOS 13.0
Represents a request or response transaction object. When both ILX and HTTP profiles are associated with a Virtual Server all traffic management is done in the context of request and response transactions.

Parameters:

Name Type Description
stream
ILXTransaction~reque st | ILXTransaction~respo nse  

Listens to Events:

Example:

 plugin.on('connect', function(flow) {
  flow.client.on('requestStart', function(request) {
    request.setHeader('X-F5-ilxTest', 'successful'); // <----- ILXTransaction request object
  });
  flow.server.on('responseComplete', function(response) {
     response.complete();   // <-------------- ILXTransaction response object
  });
});

Methods

complete()

Indicates the end of the transaction. This must be called after all headers and data have been sent. The transaction will not be sent to the client or server until ILXTransaction.complete is called.

removeHeader(headerName)

Remove headers from the transaction. It is OK to attempt to remove a header that is not in the transaction. The following items may not be removed: keepalive, method, path, query, status, version and uri. Must be called before any data is written to the stream. After the requestStart event is received the plugin may add, remove and modify headers.

Parameters:

Name Type Description
headerName
string The name of a header to remove from the transaction

replaceBody()

Discard all data received from the client (or server). The plugin can replace the body using ILXFlow.server.write (or ILXFlow.client.write).This can be called after ` <ILXStream.html#event:requestStart>`__

ILXStream#event:requestStart

or ` <ILXStream.html#event:responseStart>`__

ILXStream#event:responseStart

and before ` <#complete>`__

ILXTransaction.complete()

.

respond()

(request ILXTransaction object only) Tells the plugin that it will respond directly to the client. The request will be discarded and not sent to the server. When the requestComplete event is received the plugin may add headers and a body to the response. To send the response to the client the plugin must call ` <#complete>`__

ILXTransaction.complete()

.

setHeader(name, value)

Add or replace a header. Must be called before any data is written to the transaction. After the requestStart event is received the plugin may add, remove and modify headers.

Parameters:

Name Type Description
name
string Header name
value
string Header value

Type Definitions

request

Type:

  • object

Properties:

Name Type Description
params
object

Propertie

s
name:properties-

1

Nam e Typ e Des cri pti on
ver sio n str ing HTT P pro toc ol ver sio n
hea der s obj ect An obj ect of hea der s key :va lue pai rs
tru nca ted str ing Ind ica tes if the bod y was tru nca ted
met hod str ing Req ues t met hod
uri str ing Req ues t URI (in clu din g que ry)
pat h str ing Pat h por tio n of the URI , may be und efi ned
que ry str ing Req ues t que ry por tio n of the URI , may be und efi ned

response

Type:

  • object

Properties:

Name Type Description
params
object

Propertie

s
name:properties-

3

Nam e Typ e Des cri pti on
ver sio n str ing HTT P pro toc ol ver sio n
hea der s obj ect An obj ect of hea der s key :va lue pai rs
tru nca ted str ing Ind ica tes if the bod y was tru nca ted
sta tus str ing Res pon se sta tus
clo seC lie nt str ing

Ind ica tes whe the r the ILX fra mew ork wil l aut oma tic all y clo se the con nec tio n to the cli ent whe n ` < #co mpl ete >`_ _

ILX Tra nsa cti on. com ple te( )

is cal led . The def aul t val ue is tru e. To cha nge , set res pon se. par ams .cl ose Ser ver to fal se bef ore cal lin g

ILX Tra nsa cti on. com ple te( )

.

clo seS erv er str ing

Ind ica tes whe the r the ILX fra mew ork wil l aut oma tic all y clo se the con nec tio n to the ser ver whe n ` < #co mpl ete >`_ _

ILX Tra nsa cti on. com ple te( )

is cal led . The def aul t val ue is tru e. To cha nge , set res pon se. par ams .cl ose Ser ver to fal se bef ore cal lin g

ILX Tra nsa cti on. com ple te( )

.

The BIG-IP API Reference documentation contains community-contributed content. F5 does not monitor or control community code contributions. We make no guarantees or warranties regarding the available code, and it may contain errors, defects, bugs, inaccuracies, or security vulnerabilities. Your access to and use of any code available in the BIG-IP API reference guides is solely at your own risk.