Added a new RouteFileCache and more response extensions. Bumped package version to 1.3.4.
This commit is contained in:
@ -28,6 +28,8 @@ namespace MontoyaTech.Rest.Net.Example
|
||||
}
|
||||
}
|
||||
|
||||
public static RouteFileCache FileCache = new RouteFileCache(100 * 1024 * 1024);
|
||||
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
File.WriteAllText("test.txt", "hello from a file");
|
||||
@ -98,7 +100,9 @@ namespace MontoyaTech.Rest.Net.Example
|
||||
[RouteResponse(typeof(string))]
|
||||
public static HttpListenerResponse CompressFile(HttpListenerContext context)
|
||||
{
|
||||
return context.Response.WithStatus(HttpStatusCode.OK).WithCompressedFile("test.txt");
|
||||
var content = FileCache.Cache("test.txt");
|
||||
|
||||
return context.Response.WithStatus(HttpStatusCode.OK).WithCompressedFile("test.txt", content);
|
||||
}
|
||||
|
||||
[RouteGroup("Test")]
|
||||
|
Reference in New Issue
Block a user