@techcityventures/network-requests
v1.0.1
Published
The default package to perform requests between TCV frontend and backend.
Keywords
Readme
Network Requests
The default package to perform requests between TCV frontend and backend.
Install
npm install --save @techcityventures/network-requestsUsage
// general import
const requests = require("@techcityventures/notifications-backend")
// specific import
const { GET, POST, PUT, PATCH, DELETE } = require("@techcityventures/notifications-backend")
// usage
const url = projectSpecificUrl
// get will pass the params into the query
GET({ url, data:{ userId:"XXX", limit:10, param1: "YYY" } })
// post, put, patch, delete will transmit the parameters as json
POST({ url, data:{ userId:"XXX", limit:10, param1: "YYY" } })
PUT({ url, data:{ userId:"XXX", limit:10, param1: "YYY" } })
PATCH({ url, data:{ userId:"XXX", limit:10, param1: "YYY" } })
DELETE({ url, data:{ userId:"XXX", limit:10, param1: "YYY" } })