Использую .NET Core, RestSharp
static Task<IRestResponse> GetResponseContentAsync(RestClient theClient, RestRequest theRequest)
{
var tcs = new TaskCompletionSource<IRestResponse>();
theClient.ExecuteAsync(theRequest, response => {
tcs.SetResult(response);
});
return tcs.Task;
}
async Task<ResponseWallUploadFile> GetWallUploadFile(string url, byte[] file)
{
RestClient restClient = new RestClient(url);
var request = new RestRequest(Method.POST);
request.AddFileBytes("photo", file, "test");
var response = new RestResponse();
Task.Run(async () =>
{
response = await GetResponseContentAsync(_client, request) as RestResponse;
}).Wait();
string json = response.Content;
}
В результате получаю ошибку "413 Request Entity Too Large"
У вас есть свои варианты решения?