Category "fetch-api"

response.json() throws "TypeError: Failed to fetch"

I use fetch for getting some resources from the server. I can see from logs that from time to time conversion to JSON fails on "TypeError: Failed to fetch" whic

Use access token from first fetch in a second fetch API in React JS

As a newbie to React I have been stuck for awhile on how to get my access token to be put to use in a second fetch API. In the first fetch (Get token), I am abl

.then running before data is returned from fetch

I want show_name() to run and then call another function. I don't understand why show_name().then fails. I'm probably overlooking something. async

Using A fetch() GET Request After A fetch() POST Request Has Been Submitted To Output Database Data Without A Hard Page Refresh

I have a form that submits data with the javascript fetch() API to MySQL database with PHP. In the code below, when the form is submitted a success message is o

Javascript: get a BadRequest error from a Web Api .Net 6 using fetch

I have a little trouble using fetch, This is javascript code: function loginJS() { const login = document.getElementById('login'); const nome = documen

can't get response status code with JavaScript fetch [duplicate]

I'm trying to create a login form. when I'm testing the service with Postman, I will get a body object with status code and etc. But, with

Credentials: 'include' not including Cookie header

I'm using credentials: 'include' and mode: 'cors' on the client. On the server I see access-control-allow-credentials: true and access-control-allow-origin: htt

Query and get data from an endpoint through the a search bar input in javascript

This endpoint http://vk-data:8003/v1/entity/ returns this: [ { "id": "country", "url": "http://vk-data:8003/v1/entity/country", "nam

Fetch API with x-api-key header

I have set AWS Usage Plan and attached a key to the API. I have this code which throws 403 Forbidden. fetch(myapi, { method: 'GET', headers:

Why does Fetch post method is giving a 404 error

I'm creating a virtual store as part of my Bootcamp projects and ran into this problem when trying to get the confirmation page from the cart page using the fet

Trying to use fetch and pass in mode: no-cors

I can hit this endpoint, http://catfacts-api.appspot.com/api/facts?number=99 via Postman and it returns JSON Additionally I am using create-react-app and would

React native TypeError: Network request failed with fetch()

I'm using React native for developing an android application. With this fetch request I'm getting the error TypeError: network request failed: fetch('https://p

Slack incoming webhook: Request header field Content-type is not allowed by Access-Control-Allow-Headers in preflight response

I try to post a slack message via the fetch API in a browser: fetch('https://hooks.slack.com/services/xxx/xxx/xx', { method: 'post', headers: { 'Accept

When using mode: no-cors for a request, browser isn’t adding request header I’ve set in my frontend code

in my React app, I have the following API POST to allow the user to edit their profile (name and image). static updateProfile(formData, user_id) { const

fetch response.text() returns pending promise

I test the fetch API with jsonplaceholder URL, but my function returns "Promise State: Pending", and I don't understand why : function getUsers(url) { return

Trying to use fetch and pass in mode: no-cors

I can hit this endpoint, http://catfacts-api.appspot.com/api/facts?number=99 via Postman and it returns JSON Additionally I am using create-react-app and would

How to get the filename from a file downloaded using Javascript Fetch API?

In my Javascript client, I'm using Fetch API to call the server to retrieve a server-generated file. I'm using the following client-side code: var _url = "";

React, Fetch-API, no-cors, opaque response, but still in browser memory

I've been trying to make an React site, which would fetch a GET-response from API and print it out to my .html-file. I've managed to fetch the file just right,

Setting query string using Fetch GET request

I'm trying to use the new Fetch API: I am making a GET request like this: var request = new Request({ url: 'http://myapi.com/orders', method: 'GET' }); f

Using fetch in chrome extension sends null origin header

When sending cross origin requests using the fetch API the origin request header is being set to null instead of the chrome://xxxxx that I was expecting. Using