this is my api
https://besticon-demo.herokuapp.com/icon?url=facebook.com&size=80..120..200
when I am testing this in postman I am getting Image..But how I can do with axios
.
I am getting very long string(like �PNG...) right now with Axios
So how I can use that response to show the image..
axios.get(RequestURL, { withCredentials: false })
.then(function (response) {
// handle success
console.log(response)
var b64Response = btoa(response.data)
setImageServer('data:image/png;base64,' + b64Response) // not showing image
})
Also getting error when try to run btoa
DOMException: Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.
HTML
<img src={ImageServer}/>