I want a submit type button to send a POST request.
I am thinking about something like this:
<form action = "" method = "post">
<button>Upvote</button>
<form>
where the string "Upvote" will be send as a name in the POST request.
I know this is not working, and I know there are ways using AJAX(javascript) but I am fairly new to this area. I am just wondering if this is possible in general.
Update
Someone suggested using the <input>
tag, and I tried it. The problem is it generates a GET rather than a POST.
<button type="submit">Send it</button>
the rest of your code looks good (except the spaces), the action field holds the url to the desired server resource, which takes the data for further processing. – Wits