Start the server in one terminal:
$ bundle install
$ bake server
In another terminal, run the client:
$ bake client
You should see the following output:
--- Posting to: http://localhost:9292/content
200
#<Protocol::HTTP::Headers [["content-type", "text/plain"], ["vary", "accept-encoding"]]>
{"hello"=>"world"}
--- Posting to: http://localhost:9292/redirect-301
200
#<Protocol::HTTP::Headers [["content-type", "text/plain"], ["vary", "accept-encoding"]]>
{}
--- Posting to: http://localhost:9292/redirect-302
200
#<Protocol::HTTP::Headers [["content-type", "text/plain"], ["vary", "accept-encoding"]]>
{}
--- Posting to: http://localhost:9292/redirect-307
200
#<Protocol::HTTP::Headers [["content-type", "text/plain"], ["vary", "accept-encoding"]]>
{"hello"=>"world"}
This shows the correct behaviour of the redirets.
With the same server running, run the Go client:
$ go run client.go
You will see 500 errors as the requests are malformed.