json - Web Api 2 Object size -


ok, here strange one.

for testing issue have endpoint this:

 [httpput]     public string put(object value)     {         return value != null ? "ok" : "fail";     } 

when throwing data directly @ value object allways becomes json throw @ (as expected). app i'm developing requires me go through gateway adds security call verifying headers , so.

when going through gateway forwards endpoint seems ok until body of call hits size(apperantly 471 chars ok 472 not) value object null (and therefore method returns 'fail').

all led me believe gw truncates body @ size , therefore makes invalid json , value object becomes null. after talking provider of gateway told me tested , not issue.

here comes strange part

in further pursuit of problem added beginrequest listener this:

   context.beginrequest += application_beginrequest; 

i added 1 line interceptor debugging purposes (to see if body got truncated):

 httpcontext.current.request.saveas("c:\\test.txt", true); 

after adding line works charm, call gets thru (regardless of size) , value never null. tried removing line again , original issue fails @ size.

what on earth going on

i need advice here on how proceed debugging issue.

turned out issue in 3rd party gw anyways. trying fix problem.


Comments