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
$300 Free Credits for Your Google Cloud Projects Icon
$300 Free Credits for Your Google Cloud Projects

Start building on Google Cloud with $300 in free credits. No commitment, no credit card required until you're ready to scale.

Launch your next project with $300 in free Google Cloud credits—no strings attached. Test, build, and deploy without risk. Use your credits across the entire Google Cloud platform to find what works best for your needs. After your credits are used, continue with always-free tier services. Only pay when you're ready to scale. Sign up in minutes and start exploring.
Start Free Trial
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