Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

[CLOSED]:OSLC: How to process '|' character in HttpRequest

Hello,
I'm trying to get resources allocation info using this URI:
https://clm.local:9443/ccm/rpt/repository/apt?fields=apt/workResourceDetails/(contributor/name|assignment|startDate|endDate)

I observed that while httpClient.execute() returns valid HttpResponse for https://clm.local:9443/ccm/rpt/repository/apt?fields=apt/workResourceDetails/(contributor/name)
it returns bad response for https://clm.local:9443/ccm/rpt/repository/apt?fields=apt/workResourceDetails/(contributor/name|assignment) because I use URLEncoder.encode() in order to make safe HttpGet.

Any ideas?

-thanks in advance

0 votes


Accepted answer

Permanent link
Timur,

I suspect you need to encode the pipe symbol as any other special symbols, if you want to use them in an URL. I used https://www.google.de/search?q=html+special+characters+pipe+symbol
and found for example http://www.tutorialspoint.com/html/html_url_encoding.htm and http://en.wikipedia.org/wiki/Vertical_bar stating  pipe: 124 7c | %7c So I would try to replace the pipe with %7c.

Timur Markunin selected this answer as the correct answer

0 votes

Comments

Hi Ralph,

Thanks a lot for your response!

It was my mistake.

I used:

safeURL = URLEncoder.encode("https://clm.local:9443/ccm/rpt/repository/apt?fields=apt/workResourceDetails/(contributor/name|assignment)" , "UTF-8");

and it didn't work.

I tried:

safeUrl = URLEncoder.encode("|assignment|startDate|endDate)", "UTF-8");
String rootServices = server + "/rpt/repository/apt?fields=apt/workResourceDetails/(contributor/name"  +  safeUrl;

and it works OK.

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,927

Question asked: Apr 03 '13, 12:59 p.m.

Question was seen: 3,660 times

Last updated: Apr 05 '13, 11:06 a.m.

Confirmation Cancel Confirm