I am trying to create a stream that sends a POST request as part of a stream.
stream create form-time --definition "<working source> | generate-form-transformer: transform --script=form-generation.groovy --outputType=application/json | http-client --inputType=application/json ..." --deploy
It works, but it sets contentType to text/plain instead of application/json, which provokes a 400 since my server does not support that. (The content is perfect JSON though).
The transformer returns a XD Tuple, so as far as I understood conversion from Tuple to JSON should be done properly (in fact, as pointed out previously, the payload is correct).
However, when it comes to http-client it does not fix contentType being text/plain;UTF-8
instead of application/json
.
Any suggestions? Am I missing something? Thank you.
I don't believe the
--inputType
and--outputType
conversions are supposed to set a header, they just perform the conversion; one technique would be to add a header enricher to thehttp-client
...There is now a header-enricher processor module in spring-xd-modules.