Category "fetch-api"

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

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

Set default header for every fetch() request

Is it possible, using the fetch API, to set default headers for every single request? What I want to do is set an Authorization header whenever there is a json

NextJS - getServerSideProps - Error 400 - Bad Request

I'm getting a problem using fetch within the NEXT JS with the getServerSideProps function. As I'm starting with this framework, I'm probably not doing it well.

How do I include my credentials in getServerSideProps in Nextjs? [duplicate]

In the async function getServerSideProps I need to make a fetch from the back-end where I include my credentials to instantiate a session. I h

fetch blocked by privacy-gateway

I'm making a fetch GET request and keep on getting returned the error: Uncaught (in promise) Error: https://api.tomtom.com/search/2/search/6%george%20street.jso