问题
I am trying to access as WCF service from Visual Studio's 2015 Android Ripple Emulator but I'm getting an error 400: Bad Request. I modified the proxy.js found in C:\Users\User\AppData\Roaming\npm\node_modules\vs-tac\node_modules\ripple-emulator\lib\server\proxy.js
from:
app.use(express.bodyParser());
to:
app.use(bodyParser.text({type: '*/*'}));
but this did not solve the problem and is trying to access the WCF service as follows - http://localhost:4400/ripple/xhr_proxy?tinyhippos_apikey=ABC&tinyhippos_rur…http%3A//example.com/Service.svc/GoodToGo%3Fmessage%3DOK
Has anyone managed to solve the issue (I did not manage after going through this thread - Expressjs raw body)
回答1:
You can avoid this error by disabling the web security.
- Close all Chrome instances.
- Open Chrome with the
--disable-web-security
argument. - Run the app by Ripple.
- On the right panel of the page, click
setting -> cross domain proxy
, and set it todisable
. - Refresh the app and run.
来源:https://stackoverflow.com/questions/32762303/error-400-bad-request-from-visual-studio-2015-ripple