Is there a fully implemented javascript REST client?

I experimented and researched javascript clients for RESTful web services. Almost everything that I saw seems to be limited by the recreational definitions of the model in the client and does CRUD on simple (unrelated) models.

What i'm looking for

  • The ability to dynamically create models (and / or proxies and / or storages) in the client, taking into account the URI for the JSONREST scheme provided by the server API
  • The ability to process relationships initially (that is, without creating a bunch of user-defined functions or without overriding many of the built-in functions). I am talking about the ratios 1-> n, 1-> 1, n-> 1 and n-> m.
  • The ability to work relatively well with a full-featured client infrastructure such as ExtJS or Dojo.

What i tried

  • ExtJS 4.1: an excellent set of widgets that can fully program the layout, ajax / 'rest' proxies work from ready-made programs for simple models. There is no IRC or developer community that I can find, limited responsiveness on the GPL forums.
  • Dojo [current]: requires an individual JsonRestStore override to work with base models. Great widgets, hardly manage to completely avoid html.
  • I also looked at various jQuery-based tools and a bit on backbone.js (http://backbonejs.org is currently missing). The jquery stuff seems completely scattered to me. If there are good REST tools for jQuery, I'm open to them, I just need pointers to documentation on how to create consistent and managed applications with them.

the main goal

  • Development of web client applications that persist over time and are DRY. That is, there is a small copy {param1: 'asdf', param2: 30, ...} in all related classes. Ideally, if it is defined on the server, the client should get it from the REST API. If defined in the client, other parts of the client should be able to inherit / extend this definition.

Another way of saying this is:

  • Most JS Framework follow the MVC pattern. Which, for me, is stupid, since my "M" is already on the server along with some of the "C". I want my client to be โ€œVcโ€ in order to recreate most of the server model, which is necessary for asynchronous operation, oriented on the presentation of the user interface and user action. This means that ideally none of the โ€œMsโ€ in the โ€œMVCโ€ would be hardcoded in the client.

Is there a full-fledged javascript REST client that someone can point me to. Thanks.

+6
source share
6 answers

A few links that you most likely want to see are:

Alternate URL for Backbonejs.org : http://documentcloud.github.com/backbone/

As you know, Backbone creates objects, such as collections and models, based on your data.

Relational mapping : https://github.com/PaulUithol/Backbone-relational/

If you want to display relational data in Backbone, click on the link above

JSON Schema Validator : https://github.com/garycourt/JSV

this is convenient if you are worried about making sure you adhere to a specific JSON scheme, you can extend Backbone.js to validate the client model of the model by overriding the validate method.

+2
source

Check out my Javascript JSON-Hyper-Schema client. It dynamically creates an HTML client application using Angular, analyzing the schema provided at the endpoint of this resource using the OPTIONS method.

https://github.com/bpanahij/passportedu_schema/tree/master/client

I am working on the HATEOAS API (Hypermedia as an application state mechanism) using JSON Hyper Schema. You can go to the URL below, view, register, login and do some actions.

Check it out here: http://direct.psprt.com:8081/

I have also opened the API source code so far: https://github.com/bpanahij/passportedu_schema

Feel free to watch, take and comment.

[JSON Hyper Schema] [1] (See also [JSON-Schema] [2])

+2
source

Try https://github.com/avoidwork/abaaso , I heard nice things about this.

+1
source

If you donโ€™t need the whole structure, try: https://github.com/jpillora/jquery.rest This is completely new, so please post questions, bugs, feature requests!

0
source

I think the problem with finding a good client library is that we (as in the web community) do not yet have a complete and complete understanding of REST and the creation of the SERVER library.

Techniques such as HAL ( http://stateless.co/hal_specification.html ) may offer a better forward direction. When you have a set of APIs that pass HATEOAS ( http://en.wikipedia.org/wiki/HATEOAS ) and they really work in such a way as to allow the hyperlink to control the application, then you have the means to create VERY easy front ends who do not need to restructure each object, and rethink each business rule.

0
source

Try restful.js . Expressive syntax allows nesting of resources, is created on promises and stays in your way. It is inspired by Restangular, only it is autonomous.

Disclaimer: we wrote it.

0
source

Source: https://habr.com/ru/post/915923/


All Articles