Uh oh!
There was an error while loading. Please reload this page.
api_core: Add routing header - #4336
Conversation
| """Helpers for handling routing header params.""" | ||
| METADATA_KEY = 'x-goog-header-params' |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| def to_routing_header(params): | ||
| """Returns the routing header string that the params form""" | ||
| return "&".join(["{}={}".format(*pair) for pair in params]) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| params = [('name', 'meep'), ('book.read', True)] | ||
| metadata = routing_header.to_grpc_metadata(params) | ||
| assert metadata == ( | ||
| routing_header.METADATA_KEY, "name=meep&book.read=True") |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| """Helpers for handling routing header params.""" | ||
| try: |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| ROUTING_METADATA_KEY = 'x-goog-header-params' | ||
| def _to_url_string(x): |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| def to_routing_header(params): | ||
| """Returns the routing header string that the params form""" | ||
| return urlencode(params) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
* api_core: Add routing header * Fix linting * Review fixes * More review fixes * Documentation fixes
Example: