Answers for "make http post request javascript"

1

http request javascript

function httpGetAsync(url, callback) {
  var xmlHttp = new XMLHttpRequest();
  xmlHttp.onreadystatechange = function() { 
    if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
      callback(xmlHttp.responseText);
  }
  xmlHttp.open("GET", url, true); // true for asynchronous 
  xmlHttp.send(null);
}
Posted by: Guest on May-20-2020
0

how to make post request in javascript for api call

const data = {
    'keyone': 'valueone',
    'keytwo': 'valuetwo'
};

$.post(url, data, function(data,status){
	console.log(data);
});
Posted by: Guest on June-30-2021

Code answers related to "make http post request javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language