Tôi muốn đặt Mã hóa nội dung trên HttpResponseMessage và tôi không thể cho cuộc sống của tôi tìm hiểu cách thực hiện. Với hành động WebApi nàyLàm cách nào để đặt mã hóa nội dung trên HttpResponseMessage
public HttpResponseMessage Get()
{
byte[] tile = GetTile();
var result = new HttpResponseMessage(HttpStatusCode.OK) {Content = new ByteArrayContent(tile)};
result.Content.Headers.ContentType = new MediaTypeHeaderValue("application/x-protobuf");
return result;
}
Làm cách nào để đặt Content-Encoding trên tiêu đề thành gzip?
result.Content.Headers.ContentEncoding
chỉ đọc.
oops, làm thế nào xấu hổ. ngày dài. cảm ơn – dibs487