我正在尝试从iPhone应用程序(基于Worklight构建)向远程服务器上的远程工作灯适配器发出[1] "HY000 110 [Cloudera][ImpalaODBC] (110) Error while executing a query in Impala: [HY000] : AnalysisException: Syntax error in line 5:\n (B, F, G)\n ^\nEncountered: COMMA\nExpected: AND, BETWEEN, DIV, IN, IS, LIKE, NOT, OR, REGEXP, RLIKE\n\nCAUSED BY: Exception: Syntax error\n"
[2] "[RODBC] ERROR: Could not SQLExecDirect 'select *\n from \n DB.table \n WHERE \n (B, F, G)\n IN (vectorTest)\n LIMIT 1;'"
请求。
我使用以下
GET
但是,我一直收到以下跨域错误:
http://remote-url:port/project/authorization/v1/testtoken
但是,当我尝试使用像Postman这样的API工具执行相同的XMLHttpRequest cannot load https://remote-url/project/adapters/call/mq/getAccounts/22. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://myapp-url:port' is therefore not allowed access.
请求时,我会在浏览器上收到没有问题的结果。
答案 0 :(得分:0)
首先 - testtoken只能从MobileFirst Studio开发环境中获得......您需要考虑到这一点。
其次,您可能使用Chrome和Crome默认情况下不允许使用CORS。更改您的浏览器设置和/或在其他浏览器中尝试。