Using an http inbound gateway, I can specify a payload expression using SPEL, which will access the header, requestParams and pathVariables. How to enable body from POST? An example of what I have now,
<int-http:inbound-gateway path="/document/{product}/{id}/blah" supported-methods="GET" request-channel="documentService.blah" reply-channel="httpReplyChannel" message-converters="jsonMessageConverter" header-mapper="defaultHttpHeaderMapper" payload-expression="new RequestDTO( #pathVariables.product, #pathVariables.id, #requestParams['optionalParam'], headers.get('headerKey')) />
This works fine, however I want to add an extra parameter to the RequestDTO constructor, which is the actual body of the message (obviously, I will change the method) and serialize it to the appropriate type.
Is it possible? Thanks in advance.
source share