4

http インバウンド ゲートウェイを使用して、ヘッダー、requestParams、および pathVariables にアクセスする SPEL を使用してペイロード式を指定できます。POST から本文を含めるにはどうすればよいですか? 私が現在持っているものの例は

<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')) />

それは問題なく動作しますが、実際の投稿本文である RequestDTO コンストラクターにパラメーターを追加し (明らかにメソッドを変更します)、適切な型にシリアル化する必要があります。

これは可能ですか?前もって感謝します。

4

1 に答える 1