Tiny library for making http(s) requests.
$ npm i --save tinyreq💡 ProTip: You can install the cli version of this module by running npm i -g tinyreq-cli
const tinyreq = require("tinyreq");
// Make a request to example.com
tinyreq("http://example.com/", (err, body) => {
console.log(err || body);
});
// Make a request with custom headers
tinyreq({
url: "http://example.com/"
, headers: {
"user-agent": "Crawler/1.0"
}
}, (err, body) => {
console.log(err || body);
});Creates http(s) requests.
- String|Object
options: A string being the request url or an object containing the following fields: url(String): The request url.method(String): The request method.data(Object): The request POST data.encoding(String): The encoding type.- Function
callback: The callback function called (witherroranddataparameters).
- EventEmitter An event emitter you can use for listening for the
data,errorandendevents.
Have an idea? Found a bug? See how to contribute.
If you are using this library in one of your projects, add it in this list. ✨
cheerio-req—An http request module sending back a Cheerio object.github-colors—GitHub colors and file extensions mappingjsonrequest—A tiny library for requesting and getting JSON resources.mun(by Matheus Alves)—Obter algumas informações de qualquer município do Brasil.tinyreq-cli—A cli tool for making http(s) requests. CLI for tinyreq.wrabbit(by jillix)—Wrap scripts by providing the wrapping function.
