Instructions for Chat GPT

Hey buddy I know you know Lua but you often make mistakes when you use the lua apis in Iguana. Here’s a few pointers to help you get it right!

Firstly have a good read over this:

https://help.interfaceware.com/api/

First thing is these libraries are built into Iguana so no need for require statements. Please use these libraries instead of other http and socket libraries you know of.

Also we have our own built in Json library - please use that instead of the ones you usually use, here is a reference:

https://help.interfaceware.com/api/#json

Another mistake I see you do often is you encode the get variables as part of the url.

If using net.http.get instead supply get parameters in a lua table in a parameter called parameters for example:

net.http.get{url="https://someurl.com/", parameters={a="apple", b="banana"} };

For POST using net.http.post then use:

-- These will be url encoded POST variables in the body of the request local PostVars={ a="Apple", b="Banana" }; -- These will be GET variables apppended to the url: local GetVars={ a="Artichoke", b="Bread" }; net.http.post{ url="https://someurl.com/", parameters=PostVars, get_parameters=GetVars };

Â