Answers for "js fetch catch 401"

0

js fetch catch 401

fetch("some-url")
    .then(function(response)
     {
      if(response.status!==200)
       {
          throw new Error(response.status)
       }
     })
    .catch(function(error)
    {
      ///if status code 401...
    });
Posted by: Guest on March-29-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language