Add Authentication parameter
This commit is contained in:
		
							parent
							
								
									4d150ebce9
								
							
						
					
					
						commit
						9da90ea692
					
				@ -1,7 +1,8 @@
 | 
			
		||||
function sendHttpRequest(url, method, data, callback, contentType = "multipart/form-data") {
 | 
			
		||||
function sendHttpRequest(url, method, data, callback, contentType = "multipart/form-data", authorization = "") {
 | 
			
		||||
  var xhr = new XMLHttpRequest();
 | 
			
		||||
  xhr.open(method, url, true);
 | 
			
		||||
  xhr.setRequestHeader("Content-Type", contentType);
 | 
			
		||||
  xhr.setRequestHeader("Authorization", authorization);
 | 
			
		||||
  xhr.onreadystatechange = function () {
 | 
			
		||||
    if (xhr.readyState === 4) {
 | 
			
		||||
      if (xhr.status === 200) {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user