I was trying to POST base64 string of 2 image (4MB + in Size) in a object. Here is the Model Sample :
public class DemoModel
{
public string No{ get; set; }
public string OneBase64 { get; set; }
public string TwoBase64 { get; set; }
}
Here is how I am trying to capture POST-ed data in webapi controller.
[HttpPost]
public string PostSimpleData([FromBody] DemoModel data)
{
// do something
}
but when I post the json it shows serialization / deserialization error.
Then I added few lines in webconfig to increase response size & json size.
<system.web.extensions>
<scripting>
<webServices>
<jsonSerialization maxJsonLength="2147483647" />
</webServices>
</scripting>
</system.web.extensions>
and
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="2147483647" />
</requestFiltering>
</security>
and
<httpRuntime targetFramework="4.5" maxRequestLength="2147483647" />
Still no result. If I post anything except Base64 data It automatically serialize and bind with object in controllers method.
here is the JSON I am trying to POST.
{
"NO" : "01",
"OneBase64" : "Some base 64 Data",
"TwoBase64" : "Some base 64 Data"
}
any kind of help is appreciated.