forked from NancyFx/Nancy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestModule.cs
More file actions
30 lines (25 loc) · 791 Bytes
/
Copy pathTestModule.cs
File metadata and controls
30 lines (25 loc) · 791 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
namespace Nancy.Hosting.Wcf.Tests
{
using System.IO;
public class TestModule : NancyModule
{
public TestModule()
{
Get["/notmodified"] = parameters => {
return HttpStatusCode.NotModified;
};
Get["/rel"] = parameters => {
return "This is the site route";
};
Get["/rel/header"] = parameters =>
{
var response = new Response();
response.Headers["X-Some-Header"] = "Some value";
return response;
};
Post["/rel"] = parameters => {
return new StreamReader(this.Request.Body).ReadToEnd();
};
}
}
}