pull/3619/head
Gordon Williams 2024-10-21 10:34:38 +01:00
parent fcdced1c86
commit 2c534e5a44
1 changed files with 12 additions and 2 deletions

View File

@ -49,11 +49,21 @@ The boot code also provides some useful functions:
* `body` the body of the HTTP request
* `headers` an object of headers, eg `{HeaderOne : "headercontents"}`
`Bangle.http` returns a promise which contains:
```JS
{
t:"http",
id: // the ID of this HTTP request
resp: "...." // a string containing the response
}
```
eg:
```
```JS
Bangle.http("https://pur3.co.uk/hello.txt").then(data=>{
console.log("Got ",data);
console.log("Got ",data.resp);
});
```