Example #1
0
 public override void WriteResponseHeaders(OutputFormatterWriteContext context)
 {
     context.ContentType = FhirMediaType.GetMediaTypeHeaderValue(context.ObjectType, ResourceFormat.Xml);
     // note that the base is called last, as this may overwrite the ContentType where the resource is of type Binary
     base.WriteResponseHeaders(context);
     //   headers.ContentDisposition = new ContentDispositionHeaderValue("attachment") { FileName = "fhir.resource.json" };
 }
Example #2
0
 private static void setContentHeaders(HttpResponseMessage response, ResourceFormat format)
 {
     response.Content.Headers.ContentType = FhirMediaType.GetMediaTypeHeaderValue(typeof(Resource), format);
 }
Example #3
0
 public override void SetDefaultContentHeaders(Type type, HttpContentHeaders headers, MediaTypeHeaderValue mediaType)
 {
     base.SetDefaultContentHeaders(type, headers, mediaType);
     headers.ContentType = FhirMediaType.GetMediaTypeHeaderValue(type, ResourceFormat.Json);
     //   headers.ContentDisposition = new ContentDispositionHeaderValue("attachment") { FileName = "fhir.resource.json" };
 }