MyServices.cs 534 B

12345678910111213141516171819202122
  1. using ServiceStack;
  2. using ServicestackV6.ServiceModel;
  3. namespace ServicestackV6.ServiceInterface;
  4. public class MyServices : Service
  5. {
  6. private static readonly byte[] payload = System.Text.Encoding.UTF8.GetBytes("Hello, World!");
  7. public object Get(JsonRequest _)
  8. {
  9. Response.SetContentLength(27);
  10. return new JsonResponse();
  11. }
  12. public byte[] Get(PlainTextRequest _)
  13. {
  14. Response.SetContentLength(payload.Length);
  15. Response.ContentType = "text/plain";
  16. return payload;
  17. }
  18. }