https
On this page
https()
This function is used to perform HTTPs requests, as an alternative to node-fetch.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
| url | string | ✅ | URL to request. |
| options | HttpsOptions | ❌ | Options for Request. |
Returns
Section titled “Returns”- Promise<
Buffer | object | string>
Throws
Section titled “Throws”PromiseRejectedResult- If request fails.
[JS] Example
Section titled “[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