post
Méthode permettant d'envoyer une requête POST.
🔍 Prototype
web.post(url, data, ua, headers)
📝 Paramètres
Paramètre
Type
Description
url
string
URL.
data
string
Les données (POST) au format application/x-www-form-urlencoded.
ua
string (facultatif)
UserAgent à envoyer.
headers
Liste de string (facultatif)
Headers à envoyer.
🔙 Retour
Type
Description
false (bool)
En cas d'échec ou timeout.
string
La réponse à la requête.
📌 Exemple
local response = web.post("https://api.ipify.org/?format=json", "key1=value1&key2=value2")
local response = web.post("https://api.ipify.org/?format=json", "key1=value1&key2=value2", "Frigost")
local response = web.post("https://api.ipify.org/?format=json", "key1=value1&key2=value2", "Frigost", {"Header1: Value1", "Header2: Value2"})
Dernière mise à jour