private HttpRequestMessage BuildBinaryRequest(BoxBinaryRequest request) { HttpRequestMessage httpRequest = new HttpRequestMessage(); httpRequest.RequestUri = request.AbsoluteUri; httpRequest.Method = GetHttpMethod(request.Method); HttpContent content = null; var filePart = request.Part as BoxFilePart; if (filePart != null) { content = new StreamContent(filePart.Value); } httpRequest.Content = content; return(httpRequest); }
private HttpRequestMessage BuildBinaryRequest(BoxBinaryRequest request) { var httpRequest = new HttpRequestMessage { RequestUri = request.AbsoluteUri, Method = GetHttpMethod(request.Method) }; HttpContent content = null; var filePart = request.Part as BoxFilePart; if (filePart != null) { content = new ReusableContent(filePart.Value); } httpRequest.Content = content; return(httpRequest); }