Advertisement
Guest User

Untitled

a guest
Apr 29th, 2016
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. var request = new RestSharp.RestRequest ("api/device/stats", RestSharp.Method.POST);
  2. request.AddHeader ("Content-Type", "application/json; charset=utf-8");
  3.  
  4. request.RequestFormat = DataFormat.Json;
  5. request.AddBody(new AppUsageInfo {MAC = "ASDF"});
  6. RestSharp.IRestResponse response = client.Execute (request);
  7. var content = response.Content;
  8.  
  9. public string Post([FromUri]UsageLogModel usageState)
  10. {
  11. //LogFunction.AddUsageLogs(usageState);
  12. if (usageState.MAC == null)
  13. return "fail";
  14. else
  15. return "success";
  16. }
  17.  
  18. public class UsageLogModel
  19. {
  20. public string MAC;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement