Région de recherche :

Date :

https://stackoverflow.com › questions › 50417982

javascript - JS Fetch API access return value - Stack Overflow

fetch method returns a promise that resolves to a Response object. Once you get the response, it is up to you what to do with it. You can use methods on response body like json, text or blob to get data into desired format to work with.

https://developer.mozilla.org › fr › docs › Web › API › Fetch_API › Using_Fetch

Utiliser l'API Fetch - Les API Web | MDN - MDN Web Docs

L'API Fetch (en anglais, le verbe fetch signifie récupérer) fournit une interface JavaScript pour accéder et manipuler certaines parties du protocole, comme les requêtes et les réponses. Elle fournit également une méthode globale fetch () qui permet un accès pratique aux ressources récupérées de façon asynchrone sur le réseau.

https://www.freecodecamp.org › news › how-to-fetch-data-from-an-api-using-the-fetch-api-in...

How to Fetch Data from an API Using the Fetch API in JavaScript

One popular way to perform API requests in JavaScript is by using the Fetch API. In this article, we will explore what the Fetch API is, how it works, and I'll provide practical examples to guide you through fetching data from an API using this powerful tool.

How to Fetch Data from an API Using the Fetch API in JavaScript

https://stackoverflow.com › questions › 47604040

javascript - How to get data returned from fetch() promise? - Stack ...

function checkUserHosting(hostEmail, callback) { return fetch('http://localhost:3001/activities/' + hostEmail) .then((response) => { return response.json().then((data) => { console.log(data); return data; }).catch((err) => { console.log(err); }) }); }

https://www.digitalocean.com › ... › tutorials › how-to-use-the-javascript-fetch-api-to-get-data

How To Use the JavaScript Fetch API to Get Data | DigitalOcean

Now, JavaScript has its own built-in way to make API requests. This is the Fetch API, a new standard to make server requests with Promises, but which also includes additional features. In this tutorial, you will create both GET and POST requests using the Fetch API.

https://developer.mozilla.org › en-US › docs › Web › API › Fetch_API › Using_Fetch

Using the Fetch API - Web APIs | MDN - MDN Web Docs

By default, fetch () makes a GET request, but you can use the method option to use a different request method: const response = await fetch ("https://example.org/post", { method: "POST", // ... }); If the mode option is set to no-cors, then method must be one of GET, POST or HEAD.

https://www.javascripttutorial.net › web-apis › javascript-fetch-api

JavaScript Fetch API - JavaScript Tutorial

The fetch () is a method of the global window object, which allows you to send an HTTP request to a URL with a single command. Whether you’re retrieving data, submitting a form, or interacting with APIs, Fetch API helps streamline the entire process, making your code much readable.

https://fr.javascript.info › fetch

Fetch - JavaScript

Pour obtenir la réponse en texte, await response.text() au lieu de .json() : let response = await fetch('https://api.github.com/repos/javascript-tutorial/en.javascript.info/commits'); let text = await response.text(); // lire le corps de la réponse sous forme de texte alert(text.slice(0, 80) + '...');

https://www.digitalocean.com › ... › how-to-use-the-javascript-fetch-api-to-get-data-fr

Comment utiliser l'API Fetch de JavaScript pour ... - DigitalOcean

Au cours de ce tutoriel, vous allez apprendre à utiliser API Fetch pour créer des requêtes GET et POST.

https://attacomsian.com › blog › using-javascript-fetch-api-to-get-and-post-data

How to use the Fetch API to GET and POST data in JavaScript

A practical guide to learning how to use native JavaScript Fetch API to get and post data from a server.