📜  react native fetch response code - Javascript代码示例

📅  最后修改于: 2022-03-11 15:04:07.484000             🧑  作者: Mango

代码示例1
function processResponse(response) {
  const statusCode = response.status;
  const data = response.json();
  return Promise.all([statusCode, data]).then(res => ({
    statusCode: res[0],
    data: res[1]
  }));
}