Skip to main content
Hi All, 

I am constructing a string with pipe in string . I get the HTML code of the string . please let me know how to get around this 

Execute Anonymous: String s1 = 'https://XXXX.com/deals/search?q=createdBefore:2011-12-30|status:XXXXX|city:XXXX';

Execute Anonymous: system.debug(s1);

16:17:38.038 (38016569)|EXECUTION_STARTED

16:17:38.038 (38030801)|CODE_UNIT_STARTED|[EXTERNAL]|execute_anonymous_apex

16:17:38.038 (38922735)|SYSTEM_METHOD_ENTRY|[3]|System.debug(ANY)

16:17:38.038 (38963804)|USER_DEBUG|[3]|DEBUG|https://XXXX.com/deals/search?q=createdBefore:2011-12-30&⌗124;status:XXXXX&⌗124;city:XXXX

16:17:38.038 (38982944)|SYSTEM_METHOD_EXIT|[3]|System.debug(ANY)

The pipe in the string is being changed to &⌗124;

please help me get around this .This is the endpoint URL i need to make an webservice call out
2 answers
  1. Jan 6, 2015, 9:43 PM
    Try using EncodingUtil.urlEncode(String,'UTF-8') method to convert your URL.

     
0/9000