01-28-2021 06:40 AM
Split out from: 401 Error using Https in API REST GET call
Did you ever solve your issue?
I am experiencing something similar. To answer the question the User-Agent can be anything. Something like SnapLogic/version# replacing the number.
My issue is that when I run it in Postman I get results.
When I run it in SnapLogic the Server is saying that the query is invalid.
01-29-2021 07:24 AM
Do you have the “=“ sign enabled to make it evaluate as an expression and not just plain text?
01-29-2021 07:33 AM
I get this error:
Could not compile expression: https://serviceurl … (Reason: Encountered extraneous input ‘:’ at line 1:5; expecting={, ‘||’, ‘&&’, ‘^’, ‘==’, ‘!=’, ‘>’, ‘<’, ‘>=’, ‘<=’, ‘+’, ‘-’, ‘*’, ‘/’, ‘%’, ‘?’, ‘instanceof’, ‘in’, ‘matches’, ‘[’, ‘(’, ‘.’, PropertyRef}; Resolution: Please check expression syntax)
Query parameter looks like this:
incase the image doesn’t work:
Query parameter | Query parameter value
query | encodeURIComponent(‘select * from mytable where id < 1000’)
01-29-2021 09:17 AM
using your expression I am seeing this result:
01-29-2021 09:21 AM
It is not necessary to use encodeURIComponent. The REST Get snap will properly encode the query parameter values. Can you please show the full configuration of your REST Get snap?
01-29-2021 09:23 AM
I also have to say that providing a REST service which accepts a SQL command to execute against your database seems like a rather significant security vulnerability.