Socket
Socket
Sign inDemoInstall

rqt

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rqt

request library


Version published
Weekly downloads
3
decreased by-62.5%
Maintainers
1
Weekly downloads
 
Created
Source

rqt

npm version

rqt is a Node.js request library. Send GET and POST requests at ease.

async rqt(url: string): string

Call this function to request a web page.

const rqt = require('rqt')

(async () => {
    const res = await rqt('http://rqt.sobes.io/') // web page contents returned
})()

async rqt(url: string, { data: string, contentType: string }): string

Send a post request (with default JSON content type and calculated Content-Length). Assign more headers with headers option.

const rqt = require('rqt')

(async () => {
    const res = await rqt('http://rqt.sobes.io/post/', {
        data: JSON.stringify({ data: 'test-post-data' }),
        contentType: 'application/json', // default is assumed json
    })
})()
const rqt = require('rqt')

(async () => {
    const res = await rqt('http://rqt.sobes.io/post/headers', {
        data: 'test post data',
        contentType: 'application/x-www-form-urlencoded', // non-json request
        headers: {
            'x-token': 'token123',
        },
    })
})()

ES5

The package uses some newer language features. For your convenience, it's been transpiled to be compatible with Node 4. You can use the following snippet.

const rqt = require('rqt/es5')

(c) sobes.io 2018

Keywords

FAQs

Package last updated on 05 Mar 2018

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