0Pricing
gRPC & High Performance APIs · Leçon

gRPCurl et BloomRPC

Utilisez de puissants outils en ligne de commande et à interface graphique pour interagir avec les services gRPC et les tester.

gRPCurl et BloomRPC est une leçon gRPC & High Performance APIs gratuite sur CoddyKit. Ceci est la leçon 2 sur 4. Tu peux lire la leçon complète ci-dessous gratuitement — puis la pratiquer en direct dans le navigateur avec un éditeur de code intégré et un tuteur IA 24/7. Elle fait partie du parcours d'apprentissage gRPC & High Performance APIs, et ta progression se synchronise sur le web et l'application CoddyKit. Le cours gRPC & High Performance APIs comprend 4 leçons au total.

Certaines parties de cette leçon n'ont pas encore été traduites et s'affichent en anglais.

Why Test gRPC Services?

When building gRPC services, it's crucial to have tools that let you easily test and interact with them. Unlike REST APIs, which often use HTTP clients like Postman or curl, gRPC uses a binary protocol (Protobuf over HTTP/2) that traditional tools can't understand.

This lesson introduces two popular tools: gRPCurl for command-line interaction and BloomRPC for a user-friendly graphical interface.

Meet gRPCurl: CLI for gRPC

gRPCurl is a powerful command-line tool that lets you interact with gRPC servers. Think of it as curl, but specifically designed for gRPC.

  • It can list services and methods exposed by a gRPC server.
  • It can describe the Protobuf message types used by these methods.
  • It can invoke RPC methods with arbitrary Protobuf messages.

It's incredibly useful for quick testing, scripting, and debugging.

Installing gRPCurl

gRPCurl is a single binary, making it easy to install. You can download pre-compiled binaries from its GitHub releases page for your operating system (Linux, macOS, Windows).

Alternatively, if you have Go installed, you can install it using the Go toolchain:

go install github.com/fullstorydev/grpcurl/cmd/grpcurl@latest

gRPCurl: Listing Services

Once installed, you can use gRPCurl to inspect a running gRPC server. Let's imagine a simple Greeter service running on localhost:50051. First, we can list the available services:

grpcurl localhost:50051 list

gRPCurl: Describing Methods

To understand what a specific service or method expects, you can use the describe command. This shows you the Protobuf schema for the inputs and outputs.

For our Greeter service, let's describe the SayHello method:

grpcurl localhost:50051 describe helloworld.Greeter.SayHello

gRPCurl: Invoking a Unary RPC

Now, let's actually call the SayHello method. We need to specify the server address, the method name, and the input data as a JSON payload using the -d flag.

The -plaintext flag is used if your server is not using TLS/SSL (common for local development).

grpcurl -plaintext -d '{"name": "CoddyKit"}' localhost:50051 helloworld.Greeter.SayHello

Introducing BloomRPC: GUI for gRPC

While gRPCurl is great for scripting, sometimes a graphical user interface (GUI) makes testing more intuitive. BloomRPC is a popular open-source GUI client for gRPC services.

It provides a visual way to interact with your services, similar to how Postman works for REST APIs.

BloomRPC: Key Features

BloomRPC simplifies gRPC testing with several user-friendly features:

  • Schema Discovery: Imports .proto files to automatically discover services and methods.
  • Request Editor: Provides an intuitive JSON editor for constructing request messages.
  • Response Viewer: Displays server responses clearly.
  • History: Keeps a record of past requests, making it easy to re-run or modify them.
  • Streaming Support: Handles all four gRPC communication patterns (unary, server, client, bidirectional streaming).

Using BloomRPC for Unary Calls

To use BloomRPC, you typically:

  1. Add Protobuf Definition: Load your .proto files (or an entire directory) into BloomRPC.
  2. Select Service/Method: Choose the specific service and method you want to test from the sidebar.
  3. Edit Request: BloomRPC auto-generates a JSON template for the request message. Fill in the required data.
  4. Send Request: Click the 'Play' button to send the request to your gRPC server.
  5. View Response: The server's response will be displayed in the response panel.

Tooling Test

Which of the following statements about gRPCurl and BloomRPC are true?

Recap: gRPC Testing Essentials

In this lesson, we explored two essential tools for working with gRPC services:

  • gRPCurl: A versatile command-line tool for scripting, debugging, and quick interactions with gRPC servers.
  • BloomRPC: A user-friendly graphical interface that simplifies testing with visual schema discovery and request/response editing.

Mastering these tools will significantly boost your productivity when developing and troubleshooting gRPC-based applications. They provide different but equally valuable approaches to ensure your gRPC services are working as expected.

Questions Fréquemment Posées

La leçon « gRPCurl et BloomRPC » est-elle gratuite ?

Oui — le texte complet de « gRPCurl et BloomRPC » est gratuit à lire ici sur le web. Pour la pratiquer de manière interactive (un éditeur de code intégré et un tuteur IA 24/7) et déverrouiller le reste du cours gRPC & High Performance APIs, passe à CoddyKit PRO. Le cours gRPC & High Performance APIs comprend 4 leçons au total.

Qu'est-ce que j'apprendrai dans « gRPCurl et BloomRPC » ?

Utilisez de puissants outils en ligne de commande et à interface graphique pour interagir avec les services gRPC et les tester. Tu pratiques gRPC & High Performance APIs avec du code pratique que tu exécutes directement dans le navigateur, et un tuteur IA 24/7 répond à tes questions au fur et à mesure que tu avances dans la leçon.

Dois-je avoir de l'expérience pour commencer gRPC & High Performance APIs ?

Aucune expérience préalable n'est requise. gRPC & High Performance APIs sur CoddyKit est structuré pour les débutants jusqu'aux apprenants avancés, donc tu peux commencer ici ou depuis le début et avancer à ton rythme. Ceci est la leçon 2 sur 4.

Combien de temps prend la leçon « gRPCurl et BloomRPC » ?

La plupart des leçons CoddyKit prennent environ 5–10 minutes. Chacune est courte et interactive, tu progresses régulièrement et tu repiques exactement où tu t'es arrêté sur le web et l'app.

Peux-tu écrire et exécuter du code dans cette leçon gRPC & High Performance APIs ?

Oui. Chaque leçon gRPC & High Performance APIs inclut un éditeur de code intégré, tu écris et exécutes du vrai code directement dans ton navigateur et tu reçois des retours IA instantanés — aucune configuration locale requise.

Toutes les leçons de ce cours

  1. Intégration de gRPC-Web
  2. gRPCurl et BloomRPC
  3. Modèles de découverte de services
  4. Réflexion du serveur et clients dynamiques
← Retour à gRPC & High Performance APIs