A request logic for Advanced REST Client excluding HTTP transport.
This component is responsible for handing
api-request event, handing variables processing, request actions,
before-request event, dispatching URL history store event, communicating with transport library, and finally dispatching
api-response event. If the transport library it the hearth of the application then this component is it's brain.
This components is a part of API components ecosystem
npm install --save @advanced-rest-client/arc-request-logic
This library uses
@advanced-rest-client/arc-request-logic which depend on
Jexl and this library is not included by default in the element.
You need to add this dependency manually.
You must install Jexl on your project, and build it for browser. See
dev-lib/ folder for an example of such a build.
Finally you have to either pass the pointer to Jexl library to
jexl property or point to a relative in the
Setting Jexl reference:
const eval = document;evaljexl = myJexlVariable;
Setting path to Jexl:
This expects the Jexl library to be under
git clone https://github.com/advanced-rest-client/arc-request-logiccd arc-request-logicnpm install
Running the tests
before-request custom event to alter request properties before send.
When the handler is synchronous then there's no need for additional steps.
If the handler is asynchronous then add a
Promise to the
promises array on detail object and resolve it when ready. It is possible to set
timeout property on the promise to extend default timeout for
before-request event processing which is set to 2000ms.