Rest request body is sometimes truncated
I have an Asp.net API app where one of the API’s requests are randomly missing some of the body’s content starting from the end. All of the other APIs are very small in size so we don’t notice any issues with them. This API receives a serialized images from mobile devices and the request is no larger than 20mb in size.
Most of the time everything is OK, but randomly some requests are truncated. Its not because they are too big as some as theh would be less than 10mb in size if they were not truncated.
This is not an issue with the API because we use a logger module to log every request as a text file before it hits the endpoint so we can see exactly what is coming into the server. These requests are truncated by the time they hit the server and before they get to the endpoint/API.
Also, we know that the requests are in good shape when it leave the device.
This is an example of one of the requests:
HEADERS
Content-Length : 11237420
Content-Type : text/plain; charset=utf-8
Accept-Encoding : gzip
Host : cmtafr-prod.nwis.net
User-Agent : Dart/2.17 (dart:io)
deviceid : xxxx
appversion : 2.21.9
cap2.0_tokenkey : xxxx
osversion : 31
devicebrand : Android
devicemodel : SM-G973U
PATH
/api/IssueController/ExecuteIssue_UploadImageV2/5c2b4f27-6026-434e-a52f-a9dc495023a8
BODY
{"Isu_Id":"EC47DA70-672F-42A7-B6C2-F727DCFA8B56","ImageData":"/9j/4AAQSkZJRgABAQAAAQABAAD/2wC....
We have talked to the datacenter where this is hosted and they don’t know of anything in their environment that could be causing this (but its possible there could still be a problem in their environment).
I am really stuck and this is a huge problem. Can anyone suggest a way to trouble shoot this and/or a way to make uploading serialized image to an API “bullet proof”?
Thank you