var xmlhttp; xmlhttp=new XMLHttpRequest(); xmlhttp.open("GET","http://10.10.0.62:10001/api/charge/admin/v1/image/code",true); xmlhttp.responseType = "blob"; xmlhttp.onload = function(){ console.log(this); if (this.status == 200) { var blob = this.response; var img = document.createElement("img"); img.onload = function(e) { window.URL.revokeObjectURL(img.src); }; img.src = window.URL.createObjectURL(blob); document.body.appendChild(img); } } xmlhttp.send();