Early in Node.js I wrote an HTTP client library called request. It evolved along with Node.js and eventually became very widely depended upon. A lot has changed since 2010 and I've decided to re-think what a simple HTTP client library should look like. This new library, r2, is a completely new approach from request. Rather than being built on top of the Node.js Core HTTP library and shimmed for the browser, r2 is built on top of the browser's Fetch API and shimmed for Node.js. APIs are meant to be used with async/await, which means they are based on promises. Being written to the Fetch API is a huge benefit for browser users. When running through browserify request is ~2M uncompressed and ~500K compressed. r2 is only 66K uncompressed and 16K compressed.

Features

  • Simple JSON support
  • Simple headers support
  • Being written to the Fetch API is a huge benefit for browser users
  • r2 is built on top of the browser's Fetch API and shimmed for Node.js
  • APIs are meant to be used with async/await

Project Samples

Project Activity

See All Activity >

Categories

HTTP Clients

License

Apache License V2.0

Follow r2

r2 Web Site

Other Useful Business Software
MongoDB Atlas runs apps anywhere Icon
MongoDB Atlas runs apps anywhere

Deploy in 115+ regions with the modern database for every enterprise.

MongoDB Atlas gives you the freedom to build and run modern applications anywhere—across AWS, Azure, and Google Cloud. With global availability in over 115 regions, Atlas lets you deploy close to your users, meet compliance needs, and scale with confidence across any geography.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of r2!

Additional Project Details

Programming Language

JavaScript

Related Categories

JavaScript HTTP Clients

Registered

2021-12-07