get request error

Hello,

I want to do a get request to the ctd database. The platform communicates the following url:

Parameters:
URL: http://ctdbase.org/detail.go?type=chem&acc={ID}

Parameters:

{ID} - the MeSH® Unique ID of the chemical (e.g., “D001151”). Download the CTD chemical vocabulary.

I put the following parameter in the URL section for the get request node:
http://ctdbase.org/detail.go?type=chem&acc={“D001151”}

and get the following error:

ERROR GET Request 3:1 Execute failed: java.lang.IllegalArgumentException: Illegal character in query at index 43: http://ctdbase.org/detail.go?type=chem&acc= {“D001151”}

What is wrong?

Best regards
Werner

Hello @wbart,

This one works:
http://ctdbase.org/detail.go?type=chem&acc=D001151

I mean it executes. Haven’t verified content. I simply removed what was on at index 43 :wink:

Br,
Ivan

Hello Ivan,

what does index 43 refer to?

If you give every character in

http://ctdbase.org/detail.go?type=chem&acc={“D001151”}

a number going from left to right, starting from 0 and incrementing by 1, those are the indices. You can think of it as a position number of a character in the string.

The first character has an index of 0. Index 43 is the curly brace “{”.

1 Like

If i delete the position in the term it won`t work at all. it doesn’t make sense in my opinion too. It is very strange.

now it works. I had to completely skip the {} brackets. Thank you

Hi @wbart,

sry for not elaborating more but you figured it out.
Check here how to encode curly brackets in URL and why :wink:

Br,
Ivan

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.