Search code examples
javascripthttphttp-method

How to get the type of the HTTP request


Let's say I have an test.html file that I can either call by a POST request or a GET request. In this file I want to have a script that tells the type of the request. How should I do?

Thank you for your help.


Solution

  • There is no way for client-side JS to determine the request method used to load the current page.