Interceptors #490
Labels
priority: p3
Desirable enhancement or fix. May not be included in next release.
type: feature request
‘Nice-to-have’ improvement, new feature or different behavior or design.
Is your feature request related to a problem? Please describe.
When using
gaxios
in my project to connect to Google services, but also to third-party services. I'm connecting to APIS which uses different syntaxis for communication (for example,snake_case
) and I'm usingcamelCase
in my project. So, every time I do a request I have to decamelize (transform intosnake_case
) and when receiving the information I have to camelize it (transform intocamelCase
)In general, I'd like to extend
gaxios
to handle all the requests. So, I don't have to have multiple libraries to do the same.Describe the solution you'd like
I have used
axios
previously, and the solution which I found in that tool was being able to create interceptors to responses, but also to requests:More info: https://github.com/axios/axios#interceptors
Describe alternatives you've considered
Create one small library/util which will work as a wrap to
gaxios
, which would process (camelize the data) but also decamelize the response.Additional context
I have found already this issue:
#181
and read the implementation:
https://github.com/googleapis/gaxios/pull/319/files
but what I noticed is, that adapters are ONLY working for response and not for requests.
The text was updated successfully, but these errors were encountered: