bzamfir bzamfir - 1 year ago 118
reST (reStructuredText) Question

Return raw string from REST service method

I have a REST service method written in C#, defined as below:

[WebGet(UriTemplate = "/{par1}/{par2}/{par3}")]
public string ProcessGet(string par1, string par2, string par3)
return Execute(...);

It should return result as XML or JSON, based on one parameter (I generate the json and XML serialization)

How can I make this method to return the RAW string, just as I created it, without HTMLEncoding it?

Thank you

Answer Source

Return it as a Stream - that causes the "raw" mode to be used and WCF will not touch your response. You can find more information at

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download