Advertisement
Guest User

Untitled

a guest
May 1st, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. public interface IGitHubService
  2. {
  3. [Get("/users/{user}/repos")]
  4. Task<List<Repo>> ListRepos(string user);
  5. }
  6.  
  7. public interface IMeasurementProtocolApi
  8. {
  9. [Post("/collect")]
  10. Task Collect([Body(BodySerializationMethod.UrlEncoded)] Dictionary<string, object> data);
  11. }
  12.  
  13. var data = new Dictionary<string, object> {
  14. {"v", 1},
  15. {"tid", "UA-1234-5"},
  16. {"cid", new Guid("d1e9ea6b-2e8b-4699-93e0-0bcbd26c206c")},
  17. {"t", "event"},
  18. };
  19.  
  20. // Serialized as: v=1&tid=UA-1234-5&cid=d1e9ea6b-2e8b-4699-93e0-0bcbd26c206c&t=event
  21. await api.Collect(data);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement