コード例 #1
0
ファイル: Api.cs プロジェクト: reflection-emit/Cauldron
        private async Task PostAsync(string uri, string body, CrestTokenInfo token)
        {
            var client = new HttpClient();

            client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.AccessToken);
            client.DefaultRequestHeaders.Host          = "crest-tq.eveonline.com";
            var response = await client.PostAsync(uri, new StringContent(body, Encoding.UTF8, "application/vnd.ccp.eve.Api-v3+json"));

            response.EnsureSuccessStatusCode();
        }
コード例 #2
0
ファイル: Api.cs プロジェクト: reflection-emit/Cauldron
 private async Task PostAsync(string uri, object body, CrestTokenInfo token) =>
 await this.PostAsync(uri, JsonConvert.SerializeObject(body), token);