https()
This function is used to perform HTTPs requests, as an alternative to node-fetch
.
Parametersβ
Parameter | Type | Required | Description |
---|---|---|---|
url | string | β | URL to request. |
options | HttpsOptions | β | Options for Request. |
Returnsβ
- Promise<
Buffer | object | string
>
Throwsβ
PromiseRejectedResult
- If request fails.
[JS] Exampleβ
const {https} = require('simply-xp');
https("https://api.jena.systems")
.then(console.log) // Returns the response
.catch((err) => console.log(err)); // Returns the error