You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prepare a CSV file and test through the GA UI Data Import. Make sure it works and upload to Google Cloud Storage.
Create a local node project, with dependency to googleapis and @google-cloud/storage (could be the latest version) and google-auth-library(v2.0.2). Write code based on googleapis to do a Google Analytics Data Import based on (1) local file fs.createReadStream; (2) Google Cloud Storage file createReadStream. They both work.
Change the google-auth-library version to v3.1.2 and update the library, then run the same two functions, the GCS one will failed with the error:
Error: Media type 'application/json' is not supported. Valid media types: [application/octet-stream]
at Gaxios.
Personal thought, it looks like gaxios didn't take care the readstream from GCS very well. It will send out other request overwrite the content-type as 'json' instead of the value which is 'application/octet-stream' in the code.
Environment details
google-auth-library
version: v2.0.2 vs. v.3.1.2Steps to reproduce
Thanks!
Shu
=====Full response of the failed request=====
The text was updated successfully, but these errors were encountered: