コード例 #1
0
        public async Task HttpBin_Get()
        {
            HttpJsonClient client = new HttpJsonClient("http://httpbin.org/get");
            var            result = await client.Get();

            Assert.Equal(null, result.Exception);
        }
コード例 #2
0
        public async Task HttpBin_Put()
        {
            HttpJsonClient client = new HttpJsonClient("http://httpbin.org/post");
            Employee       emp    = DataHelper.Defalut.Employees[0];

            client.SetBody(emp);
            var result = await client.Post();

            JToken rdata = result.GetResult <JToken>()["data"];

            Assert.Equal(emp.EmployeeID, rdata.ToObject <Employee>().EmployeeID);
        }
コード例 #3
0
        public async Task HttpBin_Post()
        {
            HttpJsonClient client = new HttpJsonClient("http://httpbin.org/post");
            var            date   = DateTime.Now;

            client.SetBody(date);
            var result = await client.Post();

            JToken rdata = result.GetResult <JToken>()["data"];

            Assert.Equal(date, rdata.ToObject <DateTime>());
        }
コード例 #4
0
 public AthletesClient(string access_token)
 {
     AccessToken = access_token;
     HttpJsonClient = new HttpJsonClient(AccessToken);
 }
コード例 #5
0
 public AuthenticationClient()
 {
     HttpJsonClient = new HttpJsonClient();
 }
コード例 #6
0
 public StreamsClient(string access_token)
 {
     AccessToken = access_token;
     HttpJsonClient = new HttpJsonClient(AccessToken);
 }
コード例 #7
0
 public ActivitiesClient(string access_token)
 {
     AccessToken = access_token;
     HttpJsonClient = new HttpJsonClient(AccessToken);
 }