aminiq
TypeScript icon, indicating that this package has built-in type declarations

0.5.2 • Public • Published

AMINIQ

Another asynchronous mini request client for Node.js with 0 dependencies.

Install

npm install aminiq

Mini GET Example

const request = await aminiq("http://localhost:80/")

console.log(request.data)
console.log(request.response)

Example GET

import {aminiq} from "aminiq"

(async ()=>{
   // use object....
   let ip = await aminiq({
      hostname: "ipinfo.io",
      path: "/ip",
      method: "GET",
      port: 443,
      fileName: "",
      download: false,
      https: true
   })

   // ...or just a string
   let ip2 = await aminiq("https://ipinfo.io/ip")

   console.log(ip.data)
   console.log(ip2.data)
})()

Example POST

aminiq({
   // options
   download: false,
   fileName: "",
   hostname: this.hostname,
   https: true,
   method: this.method,
   path: this.url,
   port: 443,
   headers: this.headers
   },{
      // post data
      "param1": "value",
      "param2": "value",
      "param3": "value"
   }
})

Notes

  • Post requests only work with application/x-www-form-urlencoded

Readme

Keywords

Package Sidebar

Install

npm i aminiq

Weekly Downloads

2

Version

0.5.2

License

MIT

Unpacked Size

18.3 kB

Total Files

8

Last publish

Collaborators

  • crafter999