415 Unsupported Media Type

I had been struggling with a odd error when performing a POST from a WebApi project.

The server was refusing the request because the request is in a format not supported by that method.

The code causing the error:

Fortunately the StringContent has an overload that allows the formatting to be supplied

And that fixes this error