Reputation: 43
i want to send get request using axios and get the url html source code as response iam usin reactjs and using axios package to send the get request, but it is not working as expected. bottom of line i want to send get request and get response as in the picture below.
here is the code iam trying to make it work:
axios.get('https://www.google.com/').then((res)=>{
console.log(res.data)
})
Upvotes: 0
Views: 866
Reputation: 101
First of all, you have to know that axios GET requests returns back some data, and not source codes.
Since it can't render HTML, postman shows the source code instead.
So you can only make GET requests to a URL which returns some data
Upvotes: 1