HTTP object is a globally available HTTP client injected into every BLP command. It allows your bot to communicate with any external REST API β no imports, no setup required.
Tip: TheHTTPobject wraps Pythonβsrequestslibrary under the hood, so response objects behave similarly (.json(),.text,.status_code, etc.).
HTTP.get
Sends an HTTP GET request to the specified URL. Commonly used for fetching data from REST APIs.
Returns: A
requests.Response object. Use .json() to parse JSON, .text for raw text, .status_code for the HTTP status.
BLP Example
BLP Example (With Headers)
HTTP.post
Sends an HTTP POST request. Used for submitting data or triggering actions on external services.Note: Pass eitherdataorjson, not both at the same time.
BLP Example (JSON body)
BLP Example (Form data)
HTTP.put
Sends an HTTP PUT request. Used to replace or fully update an existing resource.BLP Example
HTTP.patch
Sends an HTTP PATCH request. Used to partially update a resource β only the fields you provide will be changed.BLP Example
HTTP.delete
Sends an HTTP DELETE request. Used to remove a resource from an external service.BLP Example
Working with Responses
AllHTTP methods return a standard response object with the following useful attributes:
BLP Example
Full Example β Sending a Notification to an External API
BLP Example
