Loading

How to disable the encoding of the HTTP request builder query parameters with Mule 4

Julkaisupäivä: Mar 2, 2024
Tehtävä

GOAL

By default, the Query Params are passed through encoding before being added to the URI, to encode any restricted character and prevent URL issues. Occasionally there is the need to prevent the encoding of the query parameters, as the parameters are required as is and there is no way to turn this off using the HTTP request-builder.
Vaiheet
The workaround to this issue is to actively add them to the path in the HTTP requester.

Below is a short example of what to do. It should just be a question of adding what you need to the path parameter, which is outside of the encoding that takes place. If you then need some of the parameters to be encoded, then they can be added within the request-builder as per usual.  

<flow name="httpqueryparamFlow" doc:id="0a63e3d2-42e8-4939-b83d-8ec248db799b" >

<http:listener doc:name="Listener" doc:id="4e0c2578-8f80-4dc2-9fd5-476dfaca98eb" config-ref="HTTP_Listener_config" path="/query"/>

<set-variable value="@@" doc:name="Set Variable" doc:id="64358048-face-4b66-a014-4ed68ab5b1f1" variableName="paramtest"/>

<http:request method="GET" doc:name="Request" doc:id="1cb6be3c-9bde-4be3-8bc0-ca4ad46ab031" config-ref="HTTP_Request_configuration" path='#[%dw 2.0

output application/java

---

"backend?value=" ++ vars.paramtest]'>

</http:request>

</flow>

Knowledge-artikkelin numero

001114686

 
Ladataan
Salesforce Help | Article