You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@r-ui/fetch

Package Overview
Dependencies
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@r-ui/fetch

A fetch wrapper.

0.12.0
latest
npmnpm
Version published
Maintainers
2
Created
Source

@r-ui/fetch

Fetch url contents.

Install

npm install @r-ui/fetch

Fetch from URL

fetch(options)

Where

  • options is an options object

Example

var fetch = require("fetch");

fetch({
    url: "http://localhost/"
});

Options

Possible option values

  • headers optional header fields, in the form of {'Header-Field':'value'}
  • method defaults to GET
  • url defaults to an empty string
  • data is an optional data object

Headers

Request headers can be set with options.headers

options = {
    headers:{
        "X-My-Header": "This is a custom header field"
    }
}

User-Agent

User-Agent value can be set with options.headers['User-Agent'] value.

options = {
    headers: {
        "User-Agent": "MyUseragent/1.0"
    }
}

License

MIT

Keywords

fetch

FAQs

Package last updated on 28 Jun 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