Search code examples
htmlanchorhrefhttp-method

Triggering any HTTP method request from pure HTML


I wold like to send a non-GET http request from my HTML web-page.

But, I don't want to use any script (js, php, etc.).

I want this request to be sent only using HTML. Is that feasible?

For example:

<!DOCTYPE html>
  <html>
    <body>
      <a href="http://www.example.com/">some text</a>
    </body>
  </html>

If a user will click on "some text" it will trigger an http GET request. Now, let's say I would like to send a POST request, but not use any scripts, only pure HTML - is that possible?


Solution

  • If you use an HTML <form> element, you can specify the method as either GET or POST.

    There is no way other way of specifying a non-GET request, nor any other HTTP verb apart from GET and POST in HTML.