Getting the full HTTP Content-Type

The Net::HTTP library that is part of ruby is usually great. While there are a number of libraries that make it easier to do simple stuff, I haven’t found one that gave me the control that I usually need over the transaction.

In constrained-voucher a multipart/mixed is returned, and knowing the parameters is important to be able to break up the resulting parameters.

The problem is that response[‘Content-Type’] returns the content-type without the parameters. To get the parameters, one needs to call response.type_params.