Headers in http source Spring cloud flow

442 Views Asked by At

I am using postman to POST a http request with a file in form-data and want to pass the filename as a header. With file as a sink i want to get that file and save it in the name of the header value filename which i passed in the http request. Below is what i tried with spring cloud flow and i am not getting the header "filename" in the sink side the file is getting saved in the name "null"

stream create --name myfilestream --definition "http --mapped-request-headers=foo --port=5555 | file --directory-expression="'Desktop' + 'sr'" --name-expression="headers['foo']" --deploy

Could someone throw some light on this.

1

There are 1 best solutions below

3
Artem Bilan On

If you use Kafka Binder , you should consider to use this option:

spring.cloud.stream.kafka.binder.headers The list of custom headers that will be transported by the binder.

Default: empty.

By default custom headers aren't transported.