This question already has an answer here:
- Make a link use POST instead of GET 9 answers
<a href="employee.action" id="employeeLink">Employee1</a>
when i click the Employee1 link, GET request goes to server. I want to make it POST instead of GET request. Is there a way i can change default GET behaviour of href?
Note:- I know it can be done where we can call javascript function on hyperlink click , then create form and submit it. But i am looking where we can mention some attribute in anchor tag to make POST request instead of GET request?
To do POST you'll need to have a form.
There are some ways to post data with hyperlinks, but you'll need some javascript, and a form.
Some tricks: Make a link use POST instead of GET and How do you post data with a link
Edit: to load response on a frame you can target your form to your frame:
Using jQuery it is very simple assuming the URL you wish to post to is on the same server or has implemented CORS
If you insist on using frames which I strongly discourage, have a form and submit it with the link
and use (in plain JS)
Without a form we need to make one