javascript - How to convert a GET request to POST -


i don't know if possible or not. referred site, didn't exact answer.

i using  <a href="xyz?id=4"> click </a> 

when send request server in response page can see "id=4" in address bar, not secure, in post request cant see this.

so can convert request post or ant other way there hide address bar.

thanks in advance.

<a href="#" onclick="postform()"> click </a> 

dynamically create , post it.

function postform() { var form = $('<form method="post" action="xyz"></form>'); $(document.body).append(form); form.append('<input type="hidden" name="id" value="4"/>'); form.submit(); } 

as racil suggested in comments, can following

<a href="#" id="postlink"> click </a> 

and then

$('#postlink').click(function(e){    e.preventdefault();    //create form , post }); 

Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

python 3.x - PyQt5 - Signal : pyqtSignal no method connect -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)