simple library for making http requests (GET/POST/PUT/PATCH/DELETE)
- specify url eg
const http = new lazyReq();
http
.get("https://jsonplaceholder.typicode.com/posts")
.then((response) => console.log(response));
- specify url , data & isJSONobj (boolean)
- (if your data is already JSON string then set third param as false,else if its a JSON obj set third param as true)
const http = new lazyReq();
http // third param --> true(for JSONobj only) & false for JSON strings
.post("https://jsonplaceholder.typicode.com/posts", Data, true)
.then((response) => console.log(response));
Pull requests are welcomed especially ones that solve error handling with fetch api
- MIT