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
Build Securely on Azure with Proven Frameworks Icon
Build Securely on Azure with Proven Frameworks

Lay a foundation for success with Tested Reference Architectures developed by Fortinet’s experts. Learn more in this white paper.

Moving to the cloud brings new challenges. How can you manage a larger attack surface while ensuring great network performance? Turn to Fortinet’s Tested Reference Architectures, blueprints for designing and securing cloud environments built by cybersecurity experts. Learn more and explore use cases in this white paper.
Download Now
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