fetch的GET请求

 

fetch(ApiConfig.url.getOpus + `?project_id=${projectId}`, {
                headers: {
                    'content-type': 'application/json',
                    'Authorization': `Bearer ${token}`
                },
                method: 'GET', // *GET, POST, PUT, DELETE, etc.
                mode: 'cors', // no-cors, cors, *same-origin
})
.then(response => response.json())
.then( .... )

 

posted @ 2020-04-10 16:21  野生野鸡码农  阅读(4795)  评论(0编辑  收藏  举报