Customizações Avançadas
Bibliotecas
HTTP
utilizada para fazer requisições utilizando o protocolo http atalhos /#get /#post /#put /#delete /#patch métodos get \ @param url string containing the url \ @param @optional headers table containing the headers of the request \ @param @optional body string containing the json encoded body \ @return a table containing headers, status, text http get(url, headers, body) \ example usage local request = http get("https //httpbin org/get") local body = request text local headers = request headers local status = request status \ \[\[ request value { headers = { \["access control allow credentials"] = "true", \["access control allow origin"] = " ", connection = "keep alive", \["content length"] = "222", \["content type"] = "application/json", date = "fri, 27 dec 2024 20 55 39 gmt", server = "gunicorn/19 9 0" }, status = 200, text = '{\n "args" {}, \n "headers" {\n "accept" " / ", \n "host" "httpbin org", \n "x amzn trace id" "root=1 676f1449 635d770f2b8b549173c3fa96"\n }, \n "origin" "186 235 83 146", \n "url" "https //httpbin org/get"\n}\n' } \ ]] post \ @param url string containing the url \ @param @optional headers table containing the headers of the request \ @param @optional body string containing the json encoded body \ @return a table containing headers, status, text http post(url, headers, body) \ example usage local request = http post( "https //httpbin org/post", { \["content type"] = "application/json" }, json encode({key = "value"}) ) local body = request text local headers = request headers local status = request status put \ @param url string containing the url \ @param @optional headers table containing the headers of the request \ @param @optional body string containing the json encoded body \ @return a table containing headers, status, text http put(url, headers, body) \ example usage local request = http put( "https //httpbin org/put", { \["content type"] = "application/json" }, nil ) local body = request text local headers = request headers local status = request status delete \ @param url string containing the url \ @param @optional headers table containing the headers of the request \ @param @optional body string containing the json encoded body \ @return a table containing headers, status, text http delete(url, headers, body) \ example usage local request = http delete( "https //httpbin org/delete", { \["content type"] = "application/json" }, nil ) local body = request text local headers = request headers local status = request status patch \ @param url string containing the url \ @param @optional headers table containing the headers of the request \ @param @optional body string containing the json encoded body \ @return a table containing headers, status, text http patch(url, headers, body) \ example usage local request = http patch("https //httpbin org/patch") local body = request text local headers = request headers local status = request status