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)); }
private async Task <EntityResponse> GetJsonResponse(HttpResponseMessage response) { return(await EntityResponse.Parse(response)); }