Chrome Extension

xhr post request with form data javascript

var data = new FormData();
data.append('username', 'username');
data.append('email', 'email');

var xhr = new XMLHttpRequest();
xhr.open('POST', 'api_url', true);
xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
xhr.onload = function () {
    // YOU WILL FIND RESPONSE HERE
    console.log(this.responseText);
};
xhr.send(data);
We are a bunch of lazy programmers so we developed this chrome extension
search code from your favorite search engine
Install Now

The code can be used to send xhr post request from your browser with form data.

Was this helpful?
0 Comments
Open Code Manager We are hiring