Example #1
0
        public async Task <EntityResponse> SendAsync(HttpMethod method, string url, object obj, bool useManagementUrl)
        {
            HttpRequestMessage message = new HttpRequestMessage(method, (useManagementUrl ? this.managementUrl : this.appUrl) + url);

            if (obj != null)
            {
                message.Content = getJsonBody(obj);
            }
            message.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
            var response = await this.client.SendAsync(message);

            return(await EntityResponse.Parse(response));
        }
Example #2
0
 private async Task <EntityResponse> GetJsonResponse(HttpResponseMessage response)
 {
     return(await EntityResponse.Parse(response));
 }