Headers

When making HTTP requests using the FireflyAIO Lua API, it's important to clear any previously set headers before defining new ones. Failing to do so will result in old headers being retained, which might lead to unexpected behavior or errors.

To ensure your headers are set correctly, use the ClearHeaders function before adding new headers:

-- Clear any existing headers
ClearHeaders()

-- Add new headers to your request
AddHeader("Name", "Value")

By calling ClearHeaders() first, you ensure that only the headers you explicitly define are included in your request. This practice helps maintain clean and predictable HTTP requests within your custom checkers in FireflyAIO.

Last updated