UWP 使用RestSharp.Portable上传文件

IRandomAccessStream fileStream = await file.OpenAsync(FileAccessMode.Read);

var bytes = new byte[fileStream.Size];

await fileStream.ReadAsync(bytes.AsBuffer(), (uint)fileStream.Size, Windows.Storage.Streams.InputStreamOptions.None);

var client = new RestClient(url);
var request = new RestRequest(Method.POST);
request.AddFile(“file_up”, bytes, file.Name);
IRestResponse response =await client.Execute(request);
var content = response.Content;