Better alternative for x-requested-with: XMLHttpRequest header


This Content is from Stack Overflow. Question asked by Zortext

With the evolution of JS we mostly use JSON to transfer data. Moreover XMLHttpRequest() method also became legacy.

We neither transfer XML nor use XMLHttpRequest() but we still add the x-requested-with: XMLHttpRequest header to inform the server about the async request type.

Is there a better, modern header for this purpose. All research leads to this legacy header.


Check the Answers

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?