We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The main use case being "authorization" e.g. via JWT.
import grpc from your_protobuf_package import my_service_pb2_grpc, my_service_pb2 # Step 1: Create a channel to the server channel = grpc.insecure_channel('localhost:50051') # Step 2: Create the stub for the service stub = my_service_pb2_grpc.MyServiceStub(channel) # Step 3: Prepare the request object request = my_service_pb2.MyRequest() # Step 4: Create metadata with Authorization header token = "your_jwt_token_here" metadata = [("authorization", f"Bearer {token}")] # Step 5: Make the gRPC call and pass metadata try: response = stub.MyMethod(request, metadata=metadata) print("Response received:", response) except grpc.RpcError as e: print(f"gRPC error: {e}")
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The main use case being "authorization" e.g. via JWT.
The text was updated successfully, but these errors were encountered: