PageRenderTime 42ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/Passbook.Sample.Web/Controllers/LogController.cs

https://github.com/Comezon/dotnet-passbook
C# | 27 lines | 23 code | 4 blank | 0 comment | 0 complexity | 55f35966990c3734d101bd5d15e18016 MD5 | raw file
  1. using Newtonsoft.Json.Linq;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Diagnostics;
  5. using System.Linq;
  6. using System.Net;
  7. using System.Net.Http;
  8. using System.Threading.Tasks;
  9. using System.Web.Http;
  10. namespace Passbook.Sample.Web.Controllers
  11. {
  12. public class LogController : ApiController
  13. {
  14. public async Task<HttpResponseMessage> Post(string version, HttpRequestMessage message)
  15. {
  16. string jsonBody = await message.Content.ReadAsStringAsync();
  17. JObject json = JObject.Parse(jsonBody);
  18. string log = json["log"].Value<string>();
  19. Debug.WriteLine(log);
  20. return new HttpResponseMessage(HttpStatusCode.OK);
  21. }
  22. }
  23. }