on 2022 Dec 06 12:27 PM
Hi everyone,
I'm having a really weird behavior with the HTTP Adapter in SAP Cloud Platform Integration.
The HTTP call is configured as below:
I'm using a property to concatenate the URL. When I lookup in the trace data, the property has the value:
But then, the HTTP call returns an error, because the adapter its replacing the %2 with a "/" character, as below:
I need to send the HTTP call with the %2F, not a "/" character. Note that the %7C (|) is not beeing replaced. It remains %7C.
Is there a way to make this possible?
Thanks,
Maicon Friedel
Request clarification before answering.
Hi Maicon,
Can you please include a groovy script to URL encode the property named 'MaterialID' before the HTTP call and try?
def value = message.getProperties().get("MaterialID");
String encodedUrl = URLEncoder.encode(value, "UTF-8");
message.setProperty("MaterialID", encodedUrl)
Regards,
Priyanka
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
import com.sap.gateway.ip.core.customdev.util.Message;
import java.util.HashMap;
import java.net.URLEncoder;
def value = message.getProperties().get("downloadLink");
String encodedUrl = URLEncoder.encode(value, "UTF-8");
message.setProperty("downloadLink", encodedUrl)
I have used this above code to encode my url but getting error :javax.script.ScriptException: groovy.lang.MissingPropertyException: No such property: message for class: encode__Script, cause: groovy.lang.MissingPropertyException: No such property: message for class: encode__Script
can you please help me?
regards,
Santosh
Just to add to your clarity, %2F is / and %7C is |. %2F(/) is in escape sequence special character and hence is correctly being converted to /. If you do not want this, Priyanka's response should help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
59 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.