0

I have an Windows Application which calls an POST API . I am attaching heavy payload in JSON with it. So with certain payload (8384132 byte) I can see that i am able to hit the API method. Where as more then this payload (i.e. 8466812 byte), i am unable to hit the API.

I am getting internal server Error.

Error details doesn't give any relevant error message.

NB--> API owned by us only.

Tried all possible Byte i.e. Max & min . Finally got this boundary of byte.

Hien Nguyen
  • 24,551
  • 7
  • 52
  • 62
lokanath das
  • 736
  • 1
  • 10
  • 35
  • If the API is owned by you, can't you debug it or expose the exception? – IronAces Apr 18 '19 at 11:33
  • As explained i checked all inner exception , error message, Its not relevant. It comes with only internal exception with Not found Http status code. As its not even hitting the API method. – lokanath das Apr 18 '19 at 11:38
  • The default request size for ASP.NET (and web api) is 4096kb or 4mb so you may need to configure that in the web.config, see also [this thread](https://stackoverflow.com/questions/31435069/webapi-2-maximum-request-length-exceeded) – Lennart Stoop Apr 18 '19 at 11:40
  • My query is kind of , any max size we need to define somewhere in the web.config? Or is there any default value that we need to modify with the max payload size or something? – lokanath das Apr 18 '19 at 11:40
  • I think that you could post some code to accompany your question. You're getting an internal server error, when hitting your API. You need to expose the contents of that exception. – IronAces Apr 18 '19 at 11:40
  • Possible duplicate of [Maximum request length exceeded.](https://stackoverflow.com/questions/3853767/maximum-request-length-exceeded) – Mihai Apr 18 '19 at 11:41
  • In this above article it have 2 points maxRequestLength,maxAllowedContentLength. So in my case its payload that i am posting to API. so which one is the correct one? M not sure if it will work or not, i can give a try – lokanath das Apr 18 '19 at 11:47
  • The first one is for IIS and should be large enough by default (28mb) so its the second one you want to configure. If that doesn't help you may want to configure the web app to show more detailed exception information – Lennart Stoop Apr 18 '19 at 11:50
  • With above configuration , i can see its hitting my API method.. – lokanath das Apr 18 '19 at 11:52

0 Answers0