Reputation: 1521
I have a server that requires all parameters sent in the url even if the value is null, however it seems that the HTTP Endpoint only sends a query-param when the value is not null.
Example: I need the request to be: http://example.com/?v1=&v2=&v3=something&v4=
But, it seems to create the request as: http://example.com/?v3=something
Example code:
<http:request-builder>
<http:query-param paramName="v1" value="#[message.inboundProperties.'http.query.params'.v1]"/>
<http:query-param paramName="v2" value="#[message.inboundProperties.'http.query.params'.v2]"/>
<http:query-param paramName="v3" value="#[message.inboundProperties.'http.query.params'.v3]"/>
<http:query-param paramName="v4" value="#[message.inboundProperties.'http.query.params'.v4]"/>
</http:request-builder>
Upvotes: 1
Views: 2408
Reputation: 2835
Which version are you using? I believe this was fixed in this issue. However, the expected URL in that case would be http://example.com/?v1&v2&v3=something&v4.
Upvotes: 0
Reputation: 4129
What about setting it to an empty string using a ternary operator instead. Example:
<http:query-param paramName="v1" value="#[message.inboundProperties.'http.query.params'.v1 != null ? message.inboundProperties.'http.query.params'.v1 : '']"/>
Upvotes: 1