private static HttpRequestMessage PrepareRequest(HttpMethod method, object body, StringBuilder urlBuilder) { var request = new HttpRequestMessage(method, urlBuilder.ToString()); request.Headers.Add("User-Agent", UserAgent); request.Headers.Add("Accept", "application/json"); if (body != null) { var content = new JsonRequestContent(body, new JsonSerializer()); HttpContent requestContent = content.GetContent(); request.Content = requestContent; } return(request); }
private static HttpRequestMessage PrepareRequest(HttpMethod method, object body, StringBuilder urlBuilder) { var request = new HttpRequestMessage(method, urlBuilder.ToString()); request.Headers.Add("User-Agent", UserAgent); request.Headers.Add("Accept", "application/json"); if (body != null) { var content = new JsonRequestContent(body, new JsonSerializer()); HttpContent requestContent = content.GetContent(); request.Content = requestContent; } return request; }