let data = 'param1=text¶m2=text' ;
let request = new XMLHttpRequest();
request.open('POST', '/my/url', true);
request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
request.send(data);
$.ajax({
type: 'POST',
url: '/my/url',
data: {
param1: text,
param2: text
}
});