Esempio n. 1
0
 private void AddFileParameters(IRestRequest request)
 {
     foreach (var pair in FileParameters)
     {
         request.AddFileBytes("File", pair.Value, pair.Key);
     }
 }
Esempio n. 2
0
        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);
        }