Please provide the Request DTO definition and the method signatures on the Service as well as the raw HTTP Request/Response Headers, you can omit the Request body and replace any sensitive info with xxxx.
I haven’t been able to repro this, which I’ve tested in both an ASP.NET and MVC app, mounted at / and /api. But I noticed your HTTP Request is incorrect, you’re saying you’re sending a multipart/form-data but the Request is posting a Stream of bytes that is invalid as it doesn’t have a multi-part boundary.
If you want to upload a file I recommend submitting a HTTP File upload which you can test with a Web Page, the Uploaded file then becomes part of the base.Request.Files collection. In this case you’re not sending a byte request body so your Request DTO should no longer implement IRequiresRequestStream. Instead
I’d recommend using the File Upload APIs on the Service Clients to ensure the HTTP File Upload Request is properly constructed or if you want to continue to use a WebRequest you can use the UploadFile extension method which takes care of properly constructing the multipart/form-data request.
With that said I’m not sure if the 405 Response is related to the invalid request, if you’re still getting the issue can you submit a small stand-alone example (e.g. on GitHub) that repro’s the issue. The Service impl shouldn’t be required, what’s important is the App Host configuration, Request + Response DTOs and Server method signature used that causes the 405 error.
There’s no maximum size imposed by ServiceStack, but the the internal OutOfMemoryException thrown from a 320MB file upload suggests you’ve exceeded the internal limits for writing a buffer to a Stream.
It’s an internal OutOfMemoryException which is typically limited by RAM available, otherwise I don’t see any way around it other than to split the upload in smaller chunks.
It looks like for large file sizes you’d need to go back to uploading raw bytes and implementing IRequiresRequestStream since that worked previously, but you’ll want to use the correct Content-Type for the file you’re uploading. If you’re still getting a 405 error response, can you put together a small standalone app that repro’s the issue so I can investigate what’s causing it.