user704988
user704988

Reputation: 436

ServiceStack request giving 500 for large request

I am using ServiceStack with MVC4 and getting 500 error when request parameters are long. I am posting ProductIds seperated by commas to controller via AJAX. In controller I have following call to servicestack API to retrieve data.

ResponseDTO res = restClient.Get(new RequestDTO { ProductIDs = ids});
//ResponseDTO res = restClient.Get(new RequestDTO { ProductIDs = "1234,1235,1236"});

If i submit small parameters in above, it works fine with no error. But when parameter string is in range of 1800 characters, it simply fails on above line and gives 500 Internal Server Error:

NetworkError: 500 Internal Server Error - http://localhost/Products/GetProducts

Exception Details: ServiceStack.ServiceClient.Web.WebServiceException: Not Found

is there a limit on GET method for posting large parameter request? Why does it fail for large request when for small parameters it successfully calls API, retrieves data via SQL procedure and sends to view correctly. What can I look into to solve this? Thank you!

p.s. when i debug via VS2012, i see exception details I see Message:Not Found and StatusCode: 404.

Upvotes: 1

Views: 696

Answers (1)

user704988
user704988

Reputation: 436

As Scott mentioned above, we tried POST for all methods and it fixed issue. I knew GET had limit on browser URL length but didnt think it matters as we had ServiceStack framework and all of their examples were using GET. Thanks again Scott.

Upvotes: 1

Related Questions