7

I have a self hosted WCF Rest service that I am using to simulate a service that I do not have access to yet. (See JSON REST Service: Content-Encoding: gzip) I gziped my response, but have not found a way to set the Content-Encoding within the HTTP response header. Is there a way to get to the HTTP header object so I can set this field?

1 Answer 1

10

you can access the response headers in your service method via the current WebOperationContext:

var response = WebOperationContext.Current.OutgoingResponse; response.Headers.Add("Content-Encoding", "gzip"); 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.