htmljquerypostgetmagento-1.4

Does html structure make difference in get or post request?


I have a href , when i click on it, it goes with "POST"request. (PS. i am using magento 1 framework)

<li>
<a href="https://www.google.com/" class="login-popup-in-footer my-account-text">Logout</a>
</li>

when i remove this "login-popup-in-footer my-account-text" it goes with GET request which is ideal. I am not sure if HTML Or htaccess file makes difference in GET OR POST request.

Feel free to share thoughts. Thankyou


Solution

  • Neither, at least not directly.

    The HTML you have will trigger a GET request. It can't do anything else.

    It will be some client-side JS that is searching the document for elements which are members of one or more of those classes and adding an event listener that prevents the default behaviour of the link and makes a POST request.

    Your server configuration can't influence it either. While it could issue a redirect response there is no way for one of those to response to a GET request in a way that causes the browser to make a POST request (although the reverse is not true).