G
G
grabbee2019-07-16 15:49:30
JavaScript
grabbee, 2019-07-16 15:49:30

What library to use for REST requests in JS?

It is necessary to send requests from the client in the browser to the API on the server. You can use fetch or axios - but it's more like RPC. There should be a convenient library for configuring API requests.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2019-07-16
@AlexanderK-A

Good day!
Requests from the browser to the api on the server are called Ajax requests. In some sense it can be called RPC.
To make such requests, there are axios libraries, part of the jQuery library, and probably something else.
fetch is a modern web api for working with Ajax requests, so it's worth learning this tool and using it where compatibility with older browsers is not very important.
If compatibility is important, use axios.

G
grinat, 2019-07-16
@grinat

Rest is no longer in fashion, everything is here https://github.com/apollographql/apollo-client

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question