Category "fetch-api"

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

Getting "TypeError: Failed to fetch" when the request hasn't actually failed

I'm using fetch API within my React app. The application was deployed on a server and was working perfectly. I tested it multiple times. But, suddenly the appli

Getting "TypeError: Failed to fetch" when the request hasn't actually failed

I'm using fetch API within my React app. The application was deployed on a server and was working perfectly. I tested it multiple times. But, suddenly the appli

How to prevent Safari from dropping the Authorization header when following a same-origin redirect?

Safari seems to drop the Authorization header when following a same-origin 301 redirect. For example, this JS code: fetch("/api/endpoint-that-redirects", { head

Detect a fetch request in PHP

How can I detect requests from the Fetch API in PHP? I am currently using the approach below to detect an AJAX request: $context['isAJAX'] = (!empty($_SERVER['

Post request to JSON server through FETCH api refreshes the page

I am trying to send POST requests through fetch API to JSON-server. Function is called on a simple button click (type 'button', not 'submit'). When I replace PO

How to fetch XML with fetch api

I'm trying to making a weather app that displays the weather and the temperature of many days of the week. I'm currently using openweathermap api for such task,

Can't post videos to Tiktok using the Web Video Kit API

I am trying to upload a video to Tiktok using this endpoint: https://open-api.tiktok.com/share/video/upload/ Following the official docs: https://developers.tik