Open sobhanrao opened 1 month ago
Tried this with both .Net Framework 4.8 and .Net Core 8.
AddFile
should work. There are tests that upload files and they all pass.
What kind of corruption do you observe? It'd be nice to know the details. Maybe you can also use requestbin to compare calls made by RS 106 and 112.
I am facing challenges after migrating from RestSharp version 106.11.4 to 112, specifically when adding attachments to ServiceNow incidents. The code that was working fine in 106.11.4 is now leading to corrupted data in the attachments after the migration.
Use the following code, which worked in version 106.11.4 working as expected.
request.AddParameter("Content-Type", "image/png"); request.Parameters.Add(new Parameter("image/png", byteArrayData, ParameterType.RequestBody));
After migrating to RestSharp 112, modify the code as follows to attempt the attachment and its failing, attachment added but corrupted.
request.AddParameter("Content-Type", "image/png"); Tried several approaches one by one all below methods, but none worked:
Please let me know if there are any specific changes in how RestSharp handles file uploads between these versions or if there is a different recommended approach in version 112.