Category "fetch-api"

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