Forum

[API] Problem with ...
 
Notifications
Retirer tout

[API] Problem with URL encoding

4 Posts
3 Utilisateurs
0 Reactions
1,187 Vu
Rafal
(@rafall92)
Posts: 10
Active Member
Début du sujet
 
[#8977]

Hello
I try to automate our process to manage documents. I find a problem with searching documents. When I use seach metod like I cant find any document if I place '%' character before name, when there is no other characters before. E.g. Lets say my document have name SEE ELECTRICAL BUILDING. When i send request to "search/name+like+'SEE+Electrical+BUILDING'" i can find that document, when i use search/name+like+'SEE+Electrical+BUILDING%' i also can find it, but if i use search/name+like+'%SEE+Electrical+BUILDING', there is no document

Also as you can see, we need to use '+' character to mark it as space. We have some document with '+' character in their name. How can we find it use method above(searching document by its name)


 
Posté : 24/07/2023 3:45 pm
(@cecile)
Posts: 160
Membre Admin
 

Hello,

In case your document name has a '+' in its name, your may try to replace it by its HTML entity while searching your document ?
'

 + 

'
 


 
Posté : 24/07/2023 3:59 pm
Rafal
(@rafall92)
Posts: 10
Active Member
Début du sujet
 

Hello
Unfortunately, entities don't work. I can use ASCII references, and if I use %47 instead of G ('SEE+Electrical+BUILDIN%47') , project can be find. But if i replace + character with its reference %2B it does not work. I can replace + character with %2B when i use it like space, and in that situation everything works, but i can't find any solution to escape '+' character. I tried to use but it also don't work


 
Posté : 24/07/2023 4:13 pm
(@babynus)
Posts: 14952
Membre Admin
 

Only alternative is to serach for name replace + with _ as in SQL _ will replace one and one only character (opposite to % that will replace 0 to many characters)


 
Posté : 24/07/2023 4:43 pm
Share:
Retour en haut