Skip to content

adessoSE/ssjs-fetch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

d9b759d · Sep 4, 2024

History

1 Commit
Sep 4, 2024
Sep 4, 2024
Sep 4, 2024
Sep 4, 2024
Sep 4, 2024
Sep 4, 2024

Repository files navigation

SSJS fetch

Simplified interface for Script.Util.HttpRequest.

Installation

npm install ssjs-fetch

Interface

Get: function (url, headers = [], continueOnError = true, retries = 0, emptyContentHandling = 0) 
Post: function (url, data, headers = [], continueOnError = true, retries = 0, emptyContentHandling = 0) 
Put: function(url, data, headers = [], continueOnError = true, retries = 0, emptyContentHandling = 0) 
Patch: function(url, data, headers = [], continueOnError = true, retries = 0, emptyContentHandling = 0) 
Delete: function (url, headers = [], continueOnError = true, retries = 0, emptyContentHandling = 0) 

Example

import $ from 'ssjs-fetch';
const result = $.Post('https://httpbin.org/post', {
    foo: 'bar'
});

About

Simplified interface for Script.Util.HttpRequest.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published