<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Jason Newman on Medium]]></title>
        <description><![CDATA[Stories by Jason Newman on Medium]]></description>
        <link>https://medium.com/@jnewmano?source=rss-9af0c003adb2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*HFqgz6fAV9HY_QS4.</url>
            <title>Stories by Jason Newman on Medium</title>
            <link>https://medium.com/@jnewmano?source=rss-9af0c003adb2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 19:20:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jnewmano/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[gRPC + Postman = ]]></title>
            <link>https://medium.com/@jnewmano/grpc-postman-173b62a64341?source=rss-9af0c003adb2------2</link>
            <guid isPermaLink="false">https://medium.com/p/173b62a64341</guid>
            <category><![CDATA[grpc]]></category>
            <category><![CDATA[postman]]></category>
            <category><![CDATA[golang]]></category>
            <dc:creator><![CDATA[Jason Newman]]></dc:creator>
            <pubDate>Thu, 02 Aug 2018 22:35:54 GMT</pubDate>
            <atom:updated>2018-09-14T22:57:41.889Z</atom:updated>
            <content:encoded><![CDATA[<p>From a technology point of view gRPC is incredible. It nicely compliments the statically typed nature of Go with the proto file specification and code generation. Overall, gRPC has increased both the robustness and the discoverability of <a href="https://getweave.com/">Weave</a>’s internal APIs. One of the downsides to gRPC is the lack of developer friendly tooling for use during development.</p><p>One of the primary complaints from our transition to gRPC has been the inability to use Postman for our gRPC services. The existing tooling has not met the ease of use the Postman providing for interacting with our traditional REST APIs. We have tried the gRPC CLI, <a href="https://github.com/grpc-ecosystem/grpc-gateway">grpc-gateway</a>, and <a href="https://github.com/troylelandshields/omgrpc">omgRPC</a>, created by one of our developers. Each of these options has slowly over time been abandoned, leading to less direct and more cumbersome methods of interacting with and exploring services.</p><p>Johan Brandhorst recently posted about <a href="https://jbrandhorst.com/post/grpc-json/">adding a JSON codec to gRPC</a> servers. While amazing, it wasn’t initially clear how this could be used to improve development workflows, especially given the <a href="https://github.com/postmanlabs/postman-app-support/issues/2701">reluctance of Postman to support HTTP/2</a> and the required binary header for the gRPC payload (whether a protocol buffer or JSON payload).</p><p>We introduce a way to use Postman with gRPC. We have created a proof of concept proxy which handles the protocol conversion from HTTP to HTTP/2 and also calculates and inserts the gRPC payload header. On the response , it trims the header off of the gRPC response and converts the gRPC status code to a HTTP status code. The introduction of this proxy allows us to once again use the incredible collaboration and templating features of Postman with our gRPC services!</p><p>Configuration of the proxy and its dependencies is a three step process.</p><ol><li>Register a JSON codec with the gRPC server. At Weave, this is as easy as using the most current version of our internal library. In Go, it can be automatically registered simple by adding the following import:</li></ol><pre>import _&quot;github.com/jnewmano/grpc-json-proxy/codec&quot;</pre><p>2. Run the grpc-json-proxy.</p><pre>go get -u github.com/jnewmano/grpc-json-proxy <br>grpc-json-proxy</pre><p>3. Configure Postman to send requests through the proxy.</p><pre>Postman -&gt; Preferences -&gt; Proxy -&gt; Global Proxy<br>Proxy Server: localhost 7001</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oc09cwpCC9XrjpU9Gl5YTw.png" /><figcaption>Postman proxy configuration</figcaption></figure><p>Using Postman with your gRPC service should then feel much more familiar:</p><ol><li>Set request method to Post .</li><li>Set the URL to http://{{ grpc server address}}/{{proto package}}.{{proto service}}/{{method}} Always use http, proxy will establish a secure connection to the gRPC server.</li><li>Set the Content-Type header to application/grpc+json .<br>Optionally add aGrpc-Insecure header set to true for an insecure connection.</li><li>Set the request body to appropriate JSON for the message. For reference, generated Go code includes JSON tags on the generated message structs.</li></ol><p>For example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*npRlBiKxuJ5KMnnk0F5n6g.png" /><figcaption>Example Postman grpc+json request</figcaption></figure><p>In the future, Postman collections can be automatically generated and published during the CI/CD process from the source proto files. Additionally, the proxy can be configured to establish port-forwarding rules into Kubernetes automatically. With autogenerated collections and Postman compatibility we hope to greatly improve the development workflow.</p><p>Notes:</p><ul><li><a href="https://github.com/jnewmano/grpc-json-proxy">github.com/jnewmano/grpc-json-proxy</a></li><li>If you have custom types in Go you will need to implement the <a href="https://godoc.org/github.com/golang/protobuf/jsonpb#JSONPBMarshaler">jsonpb.JSONPBMarshaler</a> and <a href="https://godoc.org/github.com/golang/protobuf/jsonpb#JSONPBUnmarshaler">jsonpb.JSONPBUnmarshaler</a> interfaces, which are very similar to the <a href="https://golang.org/pkg/encoding/json/#Marshaler">json.Marshaler</a> and <a href="https://golang.org/pkg/encoding/json/#Unmarshaler">json.Unmarshaler</a> interfaces.</li><li>Better support for TLS certificates will be coming soon</li><li>Don’t forget to disable the Postman proxy config if the grpc-json proxy is not running</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=173b62a64341" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>