menu
arrow_back
Back

Transcoding HTTP/JSON API calls to gRPC through API Gateway

—/100

Checkpoints

arrow_forward

Deploy the gRPC service on Cloud Run

Creating an API Config with HTTP to gRPC Transcoding

Call the API using Transcoding

Transcoding HTTP/JSON API calls to gRPC through API Gateway

1 hour 30 minutes 7 Credits

GSP881

Google Cloud Self-Paced Labs

Introduction

gRPC Transcoding is a feature for mapping between a gRPC method and one or more HTTP REST endpoints. It allows developers to build a single API service that supports both gRPC APIs and REST APIs. API Gateway enables you to provide secure access to gRPC services through a well-defined API configuration. If securing gRPC APIs through API Gateway, you may also want to support protocol transcoding so that clients can access your gRPC API by using HTTP/JSON

Transcoding involves mapping HTTP/JSON requests and their parameters to gRPC methods, their parameters and return types. Because of this, while it's possible to map an HTTP/JSON request to any arbitrary API method, it helps to do so if the gRPC API is structured in a resource-oriented way, similar to a traditional HTTP REST API.

In other words, you design the API service so that it uses a small number of standard methods, corresponding to HTTP verbs such as GET and PUT, that operate on the service's resources. These standard methods are List, Get, Create, Update, and Delete. You can find out much more about resource-oriented design and standard transcoding mappings in Google Cloud's API design guide.

In this lab you will learn how to:

  • Secure a gRPC API via API Gateway and provide the ability to call the API using HTTP/JSON.
  • Use annotations in your gRPC .proto file to specify data conversion from HTTP/JSON to gRPC.
  • How to deploy your service on Cloud Run and leverage transcoding to mediate between HTTP/JSON and gRPC.
  • Where to find more reference information about designing and implementing transcoding for gRPC services.

This lab assumes that you have already completed the Managing Cloud Run gRPC Services with API Gateway lab.

Join Qwiklabs to read the rest of this lab...and more!

  • Get temporary access to the cloud console.
  • Over 200 labs from beginner to advanced levels.
  • Bite-sized so you can learn at your own pace.
Join to Start This Lab