I want to download an image from an external API. The api provides https://cataas.com/#/ I use useEffect and axios.
const [image, setImage] = useState("");
const url = `https://cataas.com/cat`;
useEffect(() => {
axios.get(url).then((res) => console.log(res.data));
}, []);
In the console I get this result:
data: '����\x00\x10JFIF\x00\x01\x01\x01\x00H\x00H\x00\x00��\x00+Optimized by JPEGmini 3.12…\x7F5߶��;�C6��\x7F&��N�O}����\x00��\x13�\x14ǻ����t��\x11]K��+�7�\x7F��'
Status: 200
How to convert this response so that I can add the state image content to the src tag and finally display the image on the page ?