Ramesh Perera
Ramesh Perera

Reputation: 53

How to get http responce headers in vue callback without any vue library (axios)

I want to get http response headers in the callback of a get request from vuejs. But I couldn't use any library or a third party for this.

there are some third parties like axios, but in my code it doesn't allowed to use.

Upvotes: 1

Views: 194

Answers (1)

logan
logan

Reputation: 120

fetch("YOUR API REQUEST").then((res) => console.log(res.headers);
)
.then((data) =>  console.log(data))
.catch((err)=>console.error(err))

Upvotes: 1

Related Questions