public IMultipartWebRequest GenerateMultipartWebRequest(ITwitterQuery twitterQuery, string contentId, IEnumerable <IMedia> medias) { var baseURL = _webHelper.GetBaseURL(twitterQuery.QueryURL); var requestConfiguration = new MultipartRequestConfiguration(); var multipartElements = medias.Select(media => GenerateMultipartElement(media, contentId, requestConfiguration)); var requestContent = _webRequestGenerator.GenerateMultipartContent(twitterQuery.QueryURL, twitterQuery.HttpMethod, requestConfiguration, multipartElements); var baseTwitterQuery = twitterQuery.Clone(); baseTwitterQuery.QueryURL = baseURL; var request = GetQueryWebRequest(baseTwitterQuery); request.ContentType = "multipart/form-data;boundary=" + requestConfiguration.Boundary; return(new MultipartWebRequest(request, requestContent, _tweetinviSettingsAccessor)); }
public IMultipartWebRequest GenerateMultipartWebRequest(ITwitterQuery twitterQuery, string contentId, IEnumerable<IMedia> medias) { var baseURL = _webHelper.GetBaseURL(twitterQuery.QueryURL); var requestConfiguration = new MultipartRequestConfiguration(); var multipartElements = medias.Select(media => GenerateMultipartElement(media, contentId, requestConfiguration)); var requestContent = _webRequestGenerator.GenerateMultipartContent(twitterQuery.QueryURL, twitterQuery.HttpMethod, requestConfiguration, multipartElements); var baseTwitterQuery = twitterQuery.Clone(); baseTwitterQuery.QueryURL = baseURL; var request = GetQueryWebRequest(baseTwitterQuery); request.ContentType = "multipart/form-data;boundary=" + requestConfiguration.Boundary; return new MultipartWebRequest(request, requestContent, _tweetinviSettingsAccessor); }