private void AddFileParameters(IRestRequest request) { foreach (var pair in FileParameters) { request.AddFileBytes("File", pair.Value, pair.Key); } }
public async Task UploadFile(string localPath, string remotePath) { byte[] bytes = File.ReadAllBytes(localPath); string url = $"{FileSystemEndpoints.FileUploadEndpoint}?path={remotePath}"; IRestRequest request = GetRequest(url, Method.POST); request.AddFileBytes("file", bytes, "file"); await GetResponse <FileApiResponse>(request); }