Skip to content

$httpRequest

$httpRequest either posts to or retrieves data from an API.

Usage

$httpRequest[URL;method;body?;property?;error?;...header?]

Parameters

FieldTypeDescriptionRequired
URLstringURL you want to get/send data to/from.true
methodstringMethod
1. GET (default)
2. POST
3. PUT
true
body?stringContent.false
property?stringProperty to return (get method).false
error?stringError to return when request fails.false
…headerstringHeader.false

Example(s)

This will return a random dog fact using the GET method:

1
client.command({
2
name: "httpRequest",
3
code: `
4
$httpRequest[https://some-random-api.ml/facts/dog;GET;;fact;Something went wrong.]
5
`
6
});