httpq

Exported

  • get()

    httpq.get takes in the same arguments as http.get (minus the callback), however, it accepts both http and https

    Returns: Promise

    a promise that resolves to the body of the response encoded in UTF-8

  • getRaw()

    takes the same arguments as httpq.get

    Returns: Promise

    a promise that resolves to a Buffer of the retrieved data.

  • getJson()

    takes the same arguments as httpq.get

    Returns: Promise

    a promise that resolves to an object that is the result of using JSON.parse on the retrieved data.

  • getRes()

    takes the same arguments as httpq.get

    Returns: http.IncomingMessage

    the http.IncomingMessage passed into the callback of http(s).request

  • getToFile(path, ...args)

    performs a GET and write the response to a file

    1. path: string

      the path of the file that will be written

    2. ...args

      the arguments passed into httpq.get

    Returns: Promise

    a promise that resolves when the data has finished being piped into the file

  • imData(im)

    1. im: http.IncomingMessage
    Returns: Buffer

    a Buffer containing the data of im

  • http

    the http module

  • https

    the https module

  • post(body, options[, encoding])

    1. body: string

      the request body

    2. options: Object

      the same options object accept by http.request

    3. encoding: string (default: `utf-8`)

      the encoding parameter passed into request.end

    Returns: Promise

    a promise that resolves to the body of the response encoded in UTF-8

  • postJson()

    takes the same arguments as httpq.post

    Returns: Promise

    a promise that resolves to an object that is the result of using JSON.parse on the retrieved data.

  • postRaw()

    takes the same arguments as httpq.post

    Returns: Promise

    a promise that resolves to a Buffer of the retrieved data.

  • postRes()

    takes the same arguments as httpq.post

    Returns: http.IncomingMessage

    the http.IncomingMessage passed into the callback of http(s).request

  • request(reqFunc, ...args)

    1. reqFunc: Function

      a function that is passed the http.ClientRequest created by a call to http(s).request(...args)

    2. ...args

      the arguments passed to http(s).request

    Returns: Promise

    a promise that resolves to a Buffer containing the body of the response

2019-12-12T02:01:23.668Z