#!/bin/bash
URL="http://localhost:4001/twirp/code.justin.tv.example.haberdasher.Haberdasher/MakeHat"                # i.e. "http://server.com/my/method" (without quotes)
REQUEST=code.justin.tv.example.haberdasher.Size       # i.e. "Request"
RESPONSE=code.justin.tv.example.haberdasher.Hat     # i.e. "Response"
PROTO=./rpc/service.proto              # i.e. "./Protocol.proto"

cat example.msg | protoc --encode $REQUEST $PROTO | curl -sS --header "Content-Type:application/protobuf" -X POST --data-binary @- $URL | protoc --decode $RESPONSE $PROTO
