Skip to content

Instantly share code, notes, and snippets.

@tcarreira
Last active July 16, 2020 17:16
Show Gist options
  • Save tcarreira/67bb67d86131e790a8db71b952124c1f to your computer and use it in GitHub Desktop.
Save tcarreira/67bb67d86131e790a8db71b952124c1f to your computer and use it in GitHub Desktop.
Save a POST request as a bookmark
javascript:post('<site_url>',{param1:'value1',param2:'value2'});function post(a,b){const c=(e,f)=>Object.assign(document.createElement(e),f),d=c('form',{action:a,method:'post',hidden:true});for(const[e,f]of Object.entries(b))d.appendChild(c('input',{name:e,value:f}));document.body.appendChild(d),d.submit()}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment