Closed andresmejia3 closed 2 years ago
Please show how you invoke getContent()
.
await this.drive.files.getContent(fileID)
Where this.drive is a GDrive instance and fileID is a valid ID
Great. I think my supposition was right. Now, this package readme states that getContent()
Returns the result of fetch() if the call succeeds, fetchCoercesTypes
is ignored.
My question is: what does await fetch()
return?
Great. I think my supposition was right. Now, this package readme states that
getContent()
Returns the result of fetch() if the call succeeds,
fetchCoercesTypes
is ignored.My question is: what does
await fetch()
return?
I see sorry I don't know why I didn't catch it the first time. It returns a response object. So I can just get the data by doing response.body?
That's ok 😉 . Exactly, it's an ordinary fetch
.
That's ok 😉 . Exactly, it's an ordinary
fetch
.
Gotcha haha thanks again for the great Google API wrapper
I checked out the docs and the sample project but I couldn't find anything that showed how to use it. I'm not sure what type of file I'll be retrieving so I thought
getContent
would be the best for the job (please correct me if I'm mistaken). However, whenever I call it I getIn this case, the file I'm attempting to retrieve is a text file with Lorem Ipsum, but in production I plan on there being PDFs, images, videos, etc. How do I use the response object to get the contents of the file? Am I better off using
get
? From a shallow inspection it seems thatgetContent
is callingget
but withalt='media'
. Thank you!