fetch('url', {method: 'get'})
.then((response) => {
	console.log(response);
	return response.json();   //回傳的為 ReadableStream 物件,所以用json()轉換格式
}).catch((err) => {
	console.log('錯誤:', err);
})
參數
let url = 'https://hexschool-tutorial.herokuapp.com/api/signup';
fetch(url, {method: 'POST',headers: {'Content-Type': 'application/json'},body: JSON.stringify({email: 'lovef1232e@hexschool.com',password: '12345678'})
}).then((response) => {
    return response.json(); 
  }).then((jsonData) => {
    console.log(jsonData);
  }).catch((err) => {
    console.log('錯誤:', err);
})