Forum Discussion
I was kinda hoping someone would offer a suggestion on who to give the Solution to ;)
Also wanted to come back.. I've encountered another small thing that directly related to this. I've added the call I mentioned earlier that gets the deviceId value from ../rest/device/devices?filter=name:"{{var1}}*" except Jira claims :Illegal character in query at index 72
The URL sent is: https://xxxxxx.logicmonitor.com/santaba/rest/device/devices?filter=name~"new-hostaa01.xxxx.net*"
I've sanitized but maintained the number of characters.. Its complaining about the tilde, I tried replacing it with the colon but it generated the same error on the same character.
Exact same call from Postman (like earlier) works. X-Version:3 header in both.
endoceURIComponent() in javascript. Do that to your query parameter values.
- Anonymous7 months ago
encodeURIComponent()
We have AI that can paint the mona lisa, but it can't detect spelling errors?
- Anonymous7 months ago
Postman automatically encodes the values, but your JS might not be doing that. So if it works in postman with the ~, but not in your JS, you need to encode the string that contains the ~ using encodeURIComponent().
- Skeer7 months agoNeophyte
Hmm so that 'translates' to {{deviceHostname}}* at the destination however it would not work in a Jira 'Send web request' URL with a variable in the url string.
So the var won't get defined but instead passed as-is. I noticed Postman will send that encodes value as readily as the prior (name:"name-here*").
Any chance a filter can be part of the body?
- Anonymous7 months ago
No, the filter has to be in the query params. But i don't get why you can't do it. Mind posting your sanitized code?
Related Content
- 3 months ago