Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

fetch Response object get content type

// How to get Content-Type Headers from the Fetch Response Object:
fetch("https://cool.api.com/cats")
.then( response => {

  console.log( response.headers.get("content-type") );
  
  return response.json();

})
 
PREVIOUS NEXT
Tagged: #fetch #Response #object #content #type
ADD COMMENT
Topic
Name
3+2 =