HTTP
Overview
The HTTP Element serves as the entry point for external access to the Babel application, supporting configurations such as path, method, headers, and body.
You can write code within the HTTP Element. The request parameters part of the HTTP Element is based on the Koa framework, so you can leverage a variety of APIs provided by Koa in your coding. For a more comprehensive understanding of Koa's APIs, you are encouraged to visit the Koa official website.
Features
HTTP configuration
The HTTP Element allows you to customize the request path and request method.
Path
Move your mouse over the HTTP Element and click on the pencil icon to modify the path. Please note that the path generally needs to start with a '/'.
Method
The part before the path is the method of the HTTP Element. You can modify it according to your actual needs.
Access
Access in the browser
Once you have completed your coding, you can use a browser to access the HTTP Element.
Access in the Executor
In development or debugging scenarios, using a browser to access the HTTP Element may not meet our needs, such as making POST requests or passing headers. For this reason, we provide the HTTP Executor.
The HTTP Executor is an online trigger for the HTTP Element. You can set query params, headers, and body parameters, then click the 'Run' button to trigger the HTTP Element.
In addition, the HTTP Executor also integrates the capabilities of the Observation View. After waiting for a short while, you can obtain detailed information about the code execution, including return values, line-by-line code values, and information about request parameters.