A
A
Alexander Koshelev2017-09-19 21:03:49
css
Alexander Koshelev, 2017-09-19 21:03:49

How to make a GET request to api in JS?

Guys please tell me how to make a GET request to the URL in JS? I climbed the floor of the Internet but didn’t really find anything worthwhile, then with adjax requests it’s a cross domain, because you can somehow make a regular Get request in 2-3 lines !!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey delphinpro, 2019-06-05
@barabash2090

For example, like this:

A
Andrew, 2018-06-29
@Inexorable

fetch('url').then(data => data.json()).then(data => data);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question