About 400,000 results
Open links in new tab
  1. How to Call an API in JavaScript – with Examples

    Nov 3, 2023 · To make API requests in JavaScript, you can use the fetch API, which is built into modern browsers. It is a promise-based API that makes it easy to send HTTP requests and handle responses asynchronously.

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

    4 days ago · With the Fetch API, you make a request by calling fetch(), which is available as a global function in both window and worker contexts. You pass it a Request object or a string containing the URL to fetch, along with an optional argument to configure the request.

  3. 4 Ways to Make an API Call in JavaScript - GeeksforGeeks

    Aug 28, 2024 · 4 Ways to Make an API Call in JavaScript: 1. API Call in JavaScript Using XMLHttpRequest. XMLHttpRequest is an object used to make API calls in JavaScript. Before the release of ES6 which came with Fetch and libraries like Axios in 2015, it …

  4. Request - Web APIs | MDN - MDN Web Docs

    Apr 4, 2025 · The Request interface of the Fetch API represents a resource request. You can create a new Request object using the Request() constructor, but you are more likely to encounter a Request object being returned as the result of another API operation, such as a service worker FetchEvent.request.

  5. How to Make a HTTP Request in JavaScript? - GeeksforGeeks

    May 22, 2024 · JavaScript has great modules and methods to make HTTP requests that can be used to send or receive data from a server-side resource. There are several approaches to making an HTTP request in JavaScript which are as follows: The JavaScript fetch () method is used to fetch resources from a server.

  6. How to call a REST web service API from JavaScript?

    Oct 6, 2021 · It simplifies the XMLHttpRequest syntax you see in many of the other examples. The API includes a lot more, but start with the fetch() method. It takes two arguments: A URL or an object representing the request. Simple GET: const response = await fetch('http://example.com/movies.json');

  7. JavaScript Requests - GeeksforGeeks

    Apr 24, 2025 · JavaScript fetch() API. The JavaScript fetch() api can also be used to send requsets to the server to get or post the data. By default, It will send the GET request if no request type is passed. Syntax: fetch('api_address', 'request_type').then().then().catch(); Example: The below example implements the fetch() api to send the api request ...

  8. JavaScript Get Request – How to Make an HTTP Request in JS

    Dec 15, 2022 · There are two popular methods you can easily use to make HTTP requests in JavaScript. These are the Fetch API and Axios. The Fetch API is a built-in JavaScript method for retrieving resources and interacting with your backend server or an API endpoint. Fetch API is built-in and does not require installation into your project.

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

    Nov 27, 2023 · 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.

  10. Fetch API - The Modern JavaScript Tutorial

    Oct 12, 2022 · Requests are split into 3 types: Request to the same origin. Request to another origin. Request from HTTPS to HTTP (from safe to unsafe protocol). Unlike the referrer option that allows to set the exact Referer value, referrerPolicy tells the browser general rules for …

  11. Some results have been removed
Refresh