/// <summary> /// Requests information to start a new upload /// </summary> /// <param name="query">Contains the information needed to request upload information</param> /// <returns>Task containing <see cref="UploadRequest"/> information</returns> private async Task <UploadRequest> RequestUploadInformationAsync(RequestUploadQuery query) { var request = new ApiRequest <UploadRequest> { Path = "/api/upload/init", HTTPMethod = HttpMethod.Post, Query = query }; return(await _requestSender.SendRequestAsync(request).ConfigureAwait(false)); }
/// <summary> /// Requests information to start a new upload /// </summary> /// <param name="query">Contains the information needed to request upload information</param> /// <returns>Task containing <see cref="UploadRequest"/> information</returns> private Task <UploadRequest> RequestUploadInformationAsync(RequestUploadQuery query) { var request = new ApiRequest <UploadRequest> { Path = "/api/upload/init", HTTPMethod = HttpMethod.Post, Query = query }; return(_requestSender.SendRequestAsync(request)); }
public UploadRequest RequestUploadInformation(RequestUploadQuery requestUploadQuery) { if (requestUploadQuery == null || string.IsNullOrWhiteSpace(requestUploadQuery.Filename)) { return(null); } var postData = new List <KeyValuePair <string, string> > { new KeyValuePair <string, string>("filename", requestUploadQuery.Filename) }; string result = Post($"{_customerBynderUrl}/api/upload/init", postData); return((string.IsNullOrWhiteSpace(result)) ? null : JsonConvert.DeserializeObject <UploadRequest>(result.ToString())); }