Search code examples
angularpostmanangular-httpclient

Angular post request works in postman but do not work in angular


This is my POST request in postman to upload a file into drive. It works perfectly enter image description here

But, In my angular project it does not work. I get error 201 Invalid Credentials. I checked the access-token it is correct. and with the same access-token it works in postman enter image description here

Here is the error i get
enter image description here

What is the issue here? and How should I correct it?


Solution

  • I got it to work. I used FETCH instead of HttpClient. But i couldn't find a proper reason for its behaviour.