メインコンテンツまでスキップ

https()

This function is used to perform HTTPs requests, as an alternative to node-fetch.

Parameters

ParameterTypeRequiredDescription
urlstringURL to request.
optionsHttpsOptionsOptions 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