Uh oh!
There was an error while loading. Please reload this page.
feat: Add x-goog-api-client header to rest clients - #888
Conversation
Also add `Content-Type: application/json` header
Codecov Report
@@ Coverage Diff @@## master #888 +/- ##
=========================================
Coverage 100.00% 100.00% =========================================
Files 26 27 +1 Lines 1608 1697 +89 Branches 328 347 +19 =========================================
+ Hits 1608 1697 +89
Continue to review full report at Codecov.
|
| # Send the request | ||
| headers = dict(metadata) | ||
| headers['Content-Type'] = 'application/json' |
There was a problem hiding this comment.
Naive question: this is not x-goog-api-client. Where does the name content-type come from? Is there documentation somewhere describing it?
There was a problem hiding this comment.
The Content-Type header is a part of HTTP standard: https://datatracker.ietf.org/doc/html/rfc2616#section-14.17
There was a problem hiding this comment.
@software-dov See also the internal REGAPIC gRPC transcoding design doc, where we call this out explicitly (relatively recent addition, since we found some RPCs fail without it)
Uh oh!
There was an error while loading. Please reload this page.
vam-google
commented
May 18, 2021
@busunkim96 PTAL |
busunkim96
left a comment
There was a problem hiding this comment.
LGTM.
I suspect the coverage drop is from the clauses I added to keep compatibility with older google-auth and google-api-core versions in 89d6f35#diff-f7a16a65f061822bcc73b8296f4dc837353d379d8d9cc5307982cb6941442835.
busunkim96
commented
May 19, 2021
Opened PR to remove code / tests for google-api-core < 1.26.0. See #893 Once that is merged updating this branch should resolve the coverage issues. |
busunkim96
commented
May 19, 2021
@vam-google CI is now passing. |
Also add
Content-Type: application/jsonheader.This PR depends on googleapis/python-api-core#189, and assumes that google-api-core version 1.27.0 has been already released (which was not the case on the moment of creation of this PR).