Closed xixilive closed 5 years ago
Hello, I will try to reproduce the bug with the current version and fix it.
I try to reproduce the bug in my unit test => https://github.com/jgiacomini/Tiny.RestClient/blob/a5729794a88601f89dde23da8015a5666684aae4/Tests/Tiny.RestClient.Tests/MultiPartTests.cs#L65
But I can't reproduce it. Maybe I miss something.
If you don't read the response can you try like that :
var req = client.PostRequest("MultiPart/Test").AddHeader("Authorization", "TOKEN_STRING") as IRequest;
var res = await req.AsMultiPartFromDataRequest()
.AddByteArray(new byte[] { 0x11 }, "file", "picture.png", "image/jpg")
.ExecuteAsync();
I've tried what i can. IMPORTANT: My environment is Unity3D C# Script(net_standard 2.0 & .NET framework 4.x). It seems something was disposed/GC in unexpected during async processing.
Thank you so much, I will retry this with your source code after my project delivered.
I am using a release version after 8e16d65f13319e39490709a9e6a044f9b2a29acd, which fixed the 'PATCH' issue.
When I post bytes data to my server, T.RC throws exception. And if I rewrite my request with Builtin HttpClient, it works fine.
throws following exception.
HttpClient implementation works as expected.