一篇带给你Postman gRPC功能使用介绍

本文介绍了Postman支持gRPC的历程,从v9.7.1的初步支持到v9.14.0的改进,详细说明了如何在Postman中设置gRPC服务URL、选择服务方法、调用接口以及定义消息结构体。还提到Postman在导入本地文件时的限制,并分享了使用体验的提升。
摘要由CSDN通过智能技术生成

对于API调试工具来说近几年国内有不少整合的比较好的工具,比如Apifox、Apipost等。这些工具主打主打功能整合,多种功能集成一步到位,但目前对于协议的多样性则支持得较慢,截止本文写作时间点,其更多类型的支持暂时放到了后续规划中。

Postman

  Postman作为API调试的老大哥,整体的功能时比较全的,WebSocket(也是BETA)之前就已经支持了。而在最近的几个版本中Postman也提供了gRPC功能的支持。截止本文时间点,Postman最新版本为v9.14.0,所以本文也是基于该版本进行学习和功能使用介绍。

  Release Notes

  Postman在最近几个版本中对grpc的功能进行了beta测试。

  Postman v9.7.1

  在v9.7.1中Postman首次支持了gRPC功能的使用,在当时版本中已经基本支持了gRPC的单独功能使用。主要支持了单次、单双向流式的gRPC调用。同时也能使用Postman中的变量。

 在这个版本中需要我们手动在Postman中定义Proto文件。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
Postman is a popular API development tool that allows developers to create, test, and share APIs in a user-friendly interface. While Postman primarily supports REST APIs, it also supports gRPC APIs. gRPC is a high-performance, open-source framework that enables efficient communication between services using remote procedure calls (RPCs). It uses Protocol Buffers (protobuf) to define service contracts and data types, and supports a wide range of programming languages. To use Postman with gRPC, you'll need to do the following steps: 1. Install the Postman gRPC plugin: You can install the Postman gRPC plugin from the Postman app store. Once you've installed the plugin, you'll be able to create gRPC requests in Postman. 2. Define the gRPC service: Use the gRPC proto file to define the service and messages. The proto file contains the service definition and the data types used in the service. You can import the proto file into Postman and use it to create requests. 3. Create a new gRPC request: In Postman, create a new request and select the gRPC tab. Enter the service URL and select the method you want to call. You can then enter the request parameters and send the request. 4. View the response: Once you've sent the request, you can view the response in the Postman UI. The response will be displayed in a structured format based on the data types defined in the proto file. Postman also supports gRPC streaming, which allows you to make bidirectional streaming requests between a client and a server. You can use the streaming feature to send and receive large data sets or continuous data streams. Overall, using Postman with gRPC can help you streamline your API development and testing process, and make it easier to create and test high-performance APIs.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值