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

What is "amp;" in the oslc get request and why my URI doesn't work if I include that

I wanted to get all the artifacts/requirements related to specific project in DNG through APIs. 


I was actually following this YouTube video: https://www.youtube.com/watch?v=YzrVo6YM0iQ

I understood we can find the URI for this when I execute Get project request i.e, "/rm/oslc_rm/{Project_ID}/service.xml", which is tagged as <oslc:queryBase> within the node <oslc:queryCapability>

I found the URI and try to execute the exact URI without making any changes to URI as mentioned in that you tube video and I ended up with this error "Invalid URL submitted"

So after comparing the URI from you tube with my URI. The only difference I see was the word "amp;" which is placed between oslc.query and projectURL.

Here is my URI:

https://{server name}:9443/rm/views?oslc.query=true&amp;projectURL=https%3A%2F%2Fjazz-
{servername}%3A9443%2Frm%2Fprocess%2Fproject-areas%2F_jaAkFpGvPjfdCIpw

So I just removed that word and tried executing the same URI (without "amp;") and it worked.

I am confused,  what is "amp;" and why my request failed to executed when its there.

Do anyone have any idea about this?

0 votes


Accepted answer

Permanent link
& is encoded as &amp; so if you need to send '&' as part of a query string in a url you have to encode it, whereas '&' in the URL identifies a new parameter is following.  In the your string that parameter is projectURL.  This is a good example why one should not use '&' in the name of Project Areas, Team Areas, Categories, or Folders just to name a few.
Your next question is why was the amp; in the URL found by your earlier request.  This happened because the browser encoded the '&' when it displayed it to you.  As Ralph said about familiarizing yourself with URL encoding rules, it will help you recognize these things when you see them.
Dharani Muli selected this answer as the correct answer

0 votes

Comments

 Thank you Kirk Woods. For the detailed information. 


One other answer

Permanent link

 Please educate yourself about URL Encoding: https://www.w3schools.com/tags/ref_urlencode.asp

0 votes

Comments

The amp likely stands for &. 

 thank you Ralph Schoon for your suggestion. 

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
× 1,700

Question asked: Mar 14 '21, 2:47 p.m.

Question was seen: 1,830 times

Last updated: Mar 15 '21, 5:34 p.m.

Confirmation Cancel Confirm