I have created a Binary resource and if I use the ToJson() method the resulting Json is:
{
"resourceType": "Binary",
"contentType": "application/pdf",
"data": "H4sIAAAAAAAEAOy7V4vE3NYm9le....." (I've shortened this for visibility)
}
If I post this message in Postman the resource is created.
If I use
var uploadResult = await fhirClient.CreateAsync(binary);
It fails with the error Hl7.Fhir.Rest.FhirOperationException: 'Operation was unsuccessful because of a client error (UnsupportedMediaType).
Any ideas?