$httpRequest

Makes a HTTP request, with a content and headers. Returns the response content.

Usage

$httpRequest[URL;Method;Content;Header 1;Header 2;...]
  1. URL - The URL you want use for your request.
  2. Method - (Optional) default value: GET. Can be PUT, GET, POST, DELETE, HEAD or PATCH. The type of request you want to make.
  3. Content - (Optional) default value: (empty). The body of your request. Useful with POST and similar. Format is Content: value.
  4. Header N - (Optional) default value: (empty). The headers used with your request. This can be used for authorization, content-type to await and other data that your URL requires to request with.

Example

Successful http request

How to successfuly get data from an api

User06/01/2026
!!exec $httpRequest[https://api.example.com/]
Code: $httpRequestStatus
Custom Command Bot 06/01/2026
Api response!
Code: 200

Unsuccessful http request

Unsuccessful request without error message

User06/01/2026
!!exec $httpRequest[https://api.example.com/path]
Code: $httpRequestStatus
Custom Command Bot 06/01/2026
Code: 404

Warning

The response data must be less than 1 MB in size. Requests exceeding this limit will result in an error.
In order to use $httpRequest, the URL you wish to use needs to be whitelisted. To request a whitelist, please open a ticket in our Support Serveropen in new window.

Error Handling

This function does not automatically throw an error if the request fails. You must check the value of $httpRequestStatus after the request to ensure the status code is what you expect.

Function difficulty: Medium
Tags: http request api request