GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing httpyac.github.io — Scripting | httpYac Scripting It is possible to use NodeJS scripts. All scripts before the request line are executed before the request is called. All scripts after the request line are executed as soon as the response is received. All exports of the script are stored as variables. HTTP 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 WARNING Scripts are executed in a custom context/ execution environment. This context should behave identically to NodeJS Default execution environment, but there may be variations. These can be bypassed using require. WARNING The line break after Async/Await or Promise If the execution of the script is HTTP 1 2 3 4 5 6 7 8 9 10 Access to Variables All Variables already defined can be accessed via the global object. WARNING Since all variables are placed on the global scope of the script, they may overwrite other variables. Please use unique variable names In addition to the defined variables and NodeJS Global, the following values are also set on global object.
Require External scripts can be imported using require, but you need to install dependencies yourself. HTTP 1 2 3 4 5 6 7 8 9 10 11 12 TIP External dependencies must be installed independently, exceptions are , , and Dependency, which are provided from the extension. External dependencies must be installed independently, but some dependencies are provided from httpyac:
WARNING NodeJS caches all loaded scripts. Since in VS Code the script is executed in the context of the extension, the content of the script is not reloaded. Therefore, the script must be manually removed from the cache. Console The console cannot be accessed in VS Code. Therefore, a separate Console object is provided in the context of the script that redirects the output to the OutputChannel. HTTP 1 2 3 4 5 Open the OutputChannel by pressing Global Scripts Scripts with no request in the same region are always executed (Global Scripts). HTTP 1 2 3 4 5 6 Events The normal script registration is executed in order of occurrence in http File. For the execution of a request, several steps have to be executed besides the actual request: Replace Variables, Prepare Body, Pretty Print Body. With events scripts can be hooked into concrete steps in this process. HTTP 1 2 3 4 The following events are possible.
TIP The events can be registered automatically globally using HTTP 1 2 3 4 5 6 If no event is specified for global registration, the script is executed before every request. HTTP 1 2 3 4 5 6 Dynamic canceling current execution It is possible to interrupt the execution of the current HttpRegion directly. If a script exports a variable HTTP 1 2 3 4 Intellij Script Intellij Scripts are supported. An Http client and response object corresponding to the interface is created and are available in the script. WARNING The execution environment differs between NodeJS and Intellij (uses Nashorn). Possibly the behavior is not completely identical, to Intellij Execution. If there are problems, please let me know. HTTP 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 How to debug scripts
HTTP 1 2 3 4 5 6 7 8 9 10 11 12 13 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |