window.fetch发送http请求

 

    const response = await window.fetch(url,{
        method:'post',
        body:body,
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        }
    })
    if (response.ok) {
        const res = await response.json();

    }

  

posted @ 2022-06-24 21:44  非帆丶  阅读(847)  评论(0编辑  收藏  举报