New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@indlekofer/ajax_json

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@indlekofer/ajax_json

ajax request

latest
Source
npmnpm
Version
1.1.3
Version published
Maintainers
1
Created
Source

@indlekofer/ajax_json

npm version

Usage

import request from '@indlekofer/ajax_json';

let setting = {};
request(settings)
  .then((req) => {
    console.log(req.status);
    //containes the parsed json object
    console.log(req.responseJson);
  }, (req) => {
    //e.g.: timeout or json parser problems
    console.log(req.error);
  })

Parameters

settings: object settings
req: object (default XMLHttpRequest)

Settings

settings objekt

url: string (default: '/')
method: string (default: 'GET')
body: object request body
query: object request get
async: bool (default: true)
withCredentials: bool (default: false) seend cookies
auth: string (default false) base64 encoded authentication string

Errors

compare the req.error with the given error code constants

ERROR_JSON: invalid json response
ERROR_TIMEOUT: the request timed out
ERROR_REJECT: rejected request. e.g.: cors

FAQs

Package last updated on 10 Nov 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts