Conversation
|
Warning: This pull request is touching the following templated files:
|
sofisl
left a comment
There was a problem hiding this comment.
Exciting! Just so we don't confuse people, can we keep the request documentation in the README as well (you can use fetch, or request)? Also, can we create a sample for request as well?
I'll update the README to mention both are available and will be supported long-term - I think we'll want to encourage folks use the |
|
Gotcha! Maybe we can keep a request sample though and mark it as not recommended? This will also help ensure we don't break the functionality since we run sample tests. |
|
We are still testing request so no need to keep the other samples. |
Description
This will greatly improve ergonomics for customers and our downstream libraries. Notably:
GoogleAuth/AuthClientcan be a drop-in replacement for libraries requiringfetch-API complianceHere's an example for customers wanting this functionality:
Impact
Customers can now streamline their request management to:
Testing
Added tests and updated some samples to use
#fetch.Additional Information
To avoid parsing/marshaling the returned data from
GoogleAuth#fetch/AuthClient#fetchtoGaxiosResponse#data, set{responseType: 'stream'}for theGaxiosOptions.This can be useful when using this API as a drop-in replacement for
fetchand the receiving API expectsResponse#bodyUsedto befalse.We could expose a
noMarshalFetchDataoption here forAuthClientOptionsor upstream inGaxiosOptionsif this becomes a widely-desired feature.Builds on:
fetch-Compatible API gaxios#680🦕