Chunking on REST Services

Chunking on REST Services

  

Hi, 

Does anyone know if the Platform supports Chuncking on Rest Services?

Basically my ESB is translating the request and putting "Transfer-Encoding: chunked" on the HTTP Post request. So when the request arrives on the Outsystems rest service, I can see the body on the OnRequest action, but after that action is executed an exception is thrown:

The request body is missing.
   at ssjs01295.CsRESTExpose.CsTestAPI.CsTestAPIController.FlowTestAPIActionPostMethod(JSONSTInputParameterStructure auxinParamPostIn)
   at lambda_method(Closure , Object , Object[] )
   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)
   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()

...


This is the response that is sent back:
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8


Thanks in advanced for your help.


Kind regards, 

João Sousa

Hi João,

I'm not sure if the platform handles Chunking on REST Services (I don't even really know what that means), but REST services have two callback actions that might be useful for you to support it if it's not automatically handled by the platform: On Before Request and On After Response. These allow you to customize respectively the Request before it reaches the REST API methods and the Response before sending it.

Jorge Martins wrote:

Hi João,

I'm not sure if the platform handles Chunking on REST Services (I don't even really know what that means), but REST services have two callback actions that might be useful for you to support it if it's not automatically handled by the platform: On Before Request and On After Response. These allow you to customize respectively the Request before it reaches the REST API methods and the Response before sending it.

Hi Jorge, thanks for taking the time to reply.

On Before Request and On After Response and the Advanced feature on both are only available, for REST Services, for the ones that are consumed. On services that are exposed, we have OnRequest and OnResponse. As i wrote on my post, "I can see the body on the OnRequest action".

Regarding the question if the Platform supports Chunking (you can get more information here), i am not certain yet, but my latest findings give me the impression that or it doesn't support or something is being handled differently that i would expect :(