Created
December 14, 2012 02:11
-
-
Save btompkins/4281969 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ServiceContract] | |
public class HelloWorldResource { | |
[WebGet(UriTemplate="")] | |
public void Get(HttpRequestMessage req, HttpResponseMessage resp) { | |
if (req.IfNoneMatch.Contains("HW")) { | |
resp.StatusCode = HttpStatusCode.NotModified; | |
return; | |
} | |
resp.HttpContent.Create("Hello World Resource", "text/html"); | |
resp.StatusCode = HttpStatusCode.OK; | |
resp.Headers.Tag = "HW"; //set the tag | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment