Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
2
Weekly downloads
 
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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc