How do I send variables to the server with XMLHTTPRequest? Would I just add them to the end of the URL of the GET request, like ?variable1=?v
XMLHTTPRequest
GET
?variable1=?v
How about?
function callHttpService(url, params){ // Assume params contains key/value request params let queryStrings = ''; for(let key in params){ queryStrings += `${key}=${params[key]}&` } const fullUrl = `${url}?queryStrings` //make http request with fullUrl }