an asynchronous, simple, promise-based HTTP request API
examples
GET request
constpls=require("pls")pls.get("https://jsonplaceholder.typicode.com/todos/1").then(response=>response.parse())// returns reponse promise.then(body=>console.log(body))// prints response to console.catch(error=>console.log(error))// log error if there is an error
POST request
constpls=require("pls")pls.post("https://jsonplaceholder.typicode.com/posts","Hello World!",{"Content-type": "text/plain"}).then(response=>response.parse())// returns reponse promise.then(body=>console.log(body))// prints response to console.catch(error=>console.log(error))// log error if there is an error