Fetch sends pictures to the background

is canvas a picture that has been encoded by base64? how can it be sent to the background or json?

        fetch("/api/avatarUp",{
            method:"POST",
            headers: {
                "Accept": "application/json",
                "Content-Type":"application/json;charset=UTF-8"
            },
            body:JSON.stringify({avatar:canvas}),
        }).then(res => res.blob())
           .then(blob => (
               img = window.URL.createObjectURL(blob),
               this.setState({img})
               )).catch(e => console.log(e))

Mar.02,2021

use the fetch method to transfer the json data to the background, and the picture is also possible.
you can refer to this article: https://blog.csdn.net/withing.


just pass the picture of base64 to the background as a parameter.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bea86e-30f4c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bea86e-30f4c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?