-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Labels
awaiting-feedbackNeed feedback after the issue is fixed in previewNeed feedback after the issue is fixed in previewbug
Description
Describe the bug
Request.Form containd no data
To Reproduce
client side
var request = new RestRequest(resource);
var jsonData = new
{
Company = "Microsoft",
ZipCode = "LS339",
Country = "USA"
};
request.RequestFormat = DataFormat.Json;
request.Method = Method.Post;
request.AddHeader("Content-Type", "multipart/form-data");
request.AddFile("content", file, "application/octet-stream");
request.AddJsonBody(jsonData);
var response = client.ExecuteAsync(request).Result;
server side
var request = HttpContext.Current.Request;
Request.Form[0]; // index out of range exception
Expected behavior
Request.Form[0]; // expected data
Stack trace
There is not stack trace for this issue. Except behaviour has changed
after upgrading from 106.13.0 to 107.1.1
106.13.0 -> Request.Form contains key called 'application/json'
107.1.1 -> Request.Form no data
Desktop (please complete the following information):
OS: Windows 10
.NET version 4.7.2
Version: 107.1.1
Additional context
workaround
changed request.AddJsonBody(jsonData) ->request.AddParameter("application/json", JsonConvert.SerializeObject(jsonData));
has resolved the issue in 107.1.1
Metadata
Metadata
Assignees
Labels
awaiting-feedbackNeed feedback after the issue is fixed in previewNeed feedback after the issue is fixed in previewbug