From 79cf6062bcf6aa88d690ef2fab38205aa652c0b7 Mon Sep 17 00:00:00 2001 From: Paul Kulchenko Date: Tue, 3 Aug 2021 15:31:34 -0700 Subject: [PATCH] Add Fetch documentation to redbean (#97). --- tool/net/help.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tool/net/help.txt b/tool/net/help.txt index 023418113..ba5ab9dc7 100644 --- a/tool/net/help.txt +++ b/tool/net/help.txt @@ -533,6 +533,14 @@ FUNCTIONS EscapeUser(str) → str Escapes URL username. See kescapeauthority.c. + Fetch(url:str[,body:str|{method=value:str,body=value:str}]) + → status:int,{header:str=value:str,...},body:str + Sends an HTTP/HTTPS request to the specified URL. If only the URL is + provided, then a GET request is sent. If both URL and body parameters + are specified, then a POST request is sent. If any other method needs + to be specified (for example, PUT or DELETE), then passing a table as + the second value allows setting method and body values. + FormatHttpDateTime(seconds:int) → rfc1123:str Converts UNIX timestamp to an RFC1123 string that looks like this: Mon, 29 Mar 2021 15:37:13 GMT. See formathttpdatetime.c.