Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: log REST request headers #1497

Merged
merged 2 commits into from
Apr 12, 2024
Merged

Conversation

vchudnov-g
Copy link
Contributor

@vchudnov-g vchudnov-g commented Apr 11, 2024

Fixes #1494

Note that the REST server logs metadata unconditionally, so logging the request headers is not gated on passing -v to Showcase. Thus, to show headers for both the gRPC and REST transports, gapic-showcase run -v will work.

Sample output on the server console:

2024/04/11 10:15:43 Received POST request matching '/v1beta1/echo:wait': "/v1beta1/echo:wait"
2024/04/11 10:15:43   urlPathParams (expect 0, have 0): map[]
2024/04/11 10:15:43   urlRequestHeaders:
    Content-Length: "50"
    User-Agent: "curl/8.5.0"
    Accept: "*/*"
    X-Goog-Api-Client: "rest/0.0.0 gapic/0.0.0"
    Content-Type: "application/json"
2024/04/11 10:15:43   request: {
  "ttl": "3s",
  "success": {
    "content": "rainy june"
  }
}

@vchudnov-g vchudnov-g requested review from a team as code owners April 11, 2024 17:23
@vchudnov-g vchudnov-g marked this pull request as draft April 11, 2024 17:23
@vchudnov-g vchudnov-g requested review from parthea and noahdietz April 11, 2024 17:36
@vchudnov-g vchudnov-g marked this pull request as ready for review April 11, 2024 17:36
client/auxiliary.go Outdated Show resolved Hide resolved
@vchudnov-g vchudnov-g merged commit 05605c6 into googleapis:main Apr 12, 2024
9 checks passed
@vchudnov-g vchudnov-g deleted the rest-version branch April 12, 2024 05:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for printing REST request headers in verbose mode using gapic-showcase run -v
2 participants