sioapi

1.0.2 • Public • Published

SioApi

Navigator module for making API requests and controlling the responses.

Install

  npm install sioapi

Import

Bundle

import SioApi from "sioapi";

CDN

import SioApi from "https://unpkg.com/sioapi";

API

Creates a new SioApi Object.

This module extends SioEvents.

Service

Created from the call of an API.getService(name). This is used as a middleware between the apiurl and the service you're trying to fetch. Example: If API.url="https://example.com/api" A service can be: "users"

Call

Properties

Name Type Description
url String The url the request was made.
headers Object Object with the headers of the response.
blob Blob Blob of the body of the response.
response Response A Response Object with a clone of the fetch response.
status Number Number status of the response.
ok String response.ok
statusText String response.statusText.
raw Any The computed raw data of the response.
data Any The computed prefered type of the response (In case of the response being a json this is an object representation of that JSON).

Events

This fires the events "response" in the Service and in the API listeners. The listeners can change the final properties of this call.

Readme

Keywords

Package Sidebar

Install

npm i sioapi

Weekly Downloads

0

Version

1.0.2

License

ISC

Unpacked Size

25.8 kB

Total Files

4

Last publish

Collaborators

  • empirreamm