JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 77610
  • Score
    100M100P100Q163259F
  • License MIT

easily to request a url

Package Exports

  • requrl

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (requrl) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

requrl

easily to request a url

Install

npm Install requrl

Usage

This is a demo:

var request = require('requrl');

request({
    url: 'http://example.com/',				// request url, must
    method: 'POST',							// request method, default to GET
    headers: {								// headers will append, object
        "accept-content": "text/html"
    },
    data: {									// POST data, could be string, Buffer or object
        "name": "demo"
    },
    timeout: 10000,							// request timeout, default to 30000
    success: function(data, info){},		// callback while success, info is response headers
    error: function(err){}					// callback while error
});