A pure JS client for interacting with server-side RESTful resources. Think Restangular without Angular. All examples written in this README use the ES6 specification. The dist folder contains two built versions which you can use to include either restful.js or a standalone version. Standalone version already embeds fetch. Restful.js needs an HTTP backend in order to perform queries. A custom endpoint acts like a member, and therefore you can use one and all to chain another endpoint with it. Once you have collections and members endpoints, fetch them to get entities. Restful.js exposes get() and getAll() methods for fetching endpoints. Since these methods are asynchronous, they return a native Promise for response. A response is made from the HTTP response fetched from the endpoint. It exposes statusCode(), headers(), and body() methods. For a GET request, the body method will return one or an array of entities. Therefore you can disable this hydration by calling body(false).

Features

  • All examples written in this README use the ES6 specification
  • Create a resource targeting your API
  • Two http backend are currently available
  • Use restful.js in a browser
  • Use restful.js in Node.js
  • Collections and Members endpoints

Project Samples

Project Activity

See All Activity >

Categories

Front-Ends

License

MIT License

Follow restful.js

restful.js Web Site

Other Useful Business Software
Earn up to 15% annual interest with Nexo. Icon
Earn up to 15% annual interest with Nexo.

Access competitive interest rates on your digital assets.

Generate interest, borrow against your crypto, and trade a range of cryptocurrencies — all in one platform. Geographic restrictions, eligibility, and terms apply.
Get started with Nexo.
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of restful.js!

Additional Project Details

Programming Language

JavaScript

Related Categories

JavaScript Front-Ends

Registered

2022-12-07