Closed rexn8r closed 2 years ago
ok got it.
header is to be added.
Image Download
var client = new Tiny.RestClient.TinyRestClient(new HttpClient(), "http://localhost:4044/"); string filePath = Environment.CurrentDirectory + "\test.png"; FileInfo fileInfo = await client. GetRequest("assets/test.png"). AddHeader("Accept", "image/png"). DownloadFileAsync(filePath);
video download
var client = new Tiny.RestClient.TinyRestClient(new HttpClient(), "http://localhost:4044/"); string filePath = Environment.CurrentDirectory + "\test.mp4"; FileInfo fileInfo = await client. GetRequest("assets/test.mp4"). AddHeader("Accept", "video/mp4"). DownloadFileAsync(filePath);
thanks rex
Hello
how would i download image as well as video files using this package?
var client = new Tiny.RestClient.TinyRestClient(new HttpClient(), "http://localhost:4044"); string filePath = Environment.CurrentDirectory + "\test.png"; FileInfo fileInfo = await client. GetRequest("assets/test.png"). DownloadFileAsync(filePath);
it throws following error;
Tiny.RestClient.HttpException: 'Response status code does not indicate success. Url : http://localhost:4044/assets/test.png, Verb : GET, StatusCode : NotAcceptable, ReasonPhrase : Not Acceptable'
thanks rex