on 06-27-2023 4:22 PM
Dear Builders,
I am following some tutorials on SAP Build Apps (AppGyver). In one of these tutorials I need to connect a restdb.io server with a rest api direct integration.
When I enter the resource url, the API key and click Get Collection on test, the following error message appears: 'Error: TypeError: Failed to fetch. Does the server allow CORS?status: undefined'.
To overcome the problem I have tried everything, including multiple headers. Nothing works. A colleague tried the same in Postmen. Things went well here.
I have followed the tutorial one on one, but it does not dwell on a possible error message. I get stuck.
Does anyone know a solution that I can use? Thank you in advance!
berryvanbree
in you restdb.io while generating key .. you can enable CORS
https://restdb.io/docs/apikeys-and-cors#restdb
I just tried with sample example in restdb.io ... I am able to get results without CORS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Yogananda,server-2.pngserver-3.png
Thank you for the quick response! I (and my colleagues) started working on the documentation.
The test still gives an error. We don't understand what we're doing wrong. I have attached screenshots of our new configuration.
What are we doing wrong?
Could you please look?
Thank you in advance!
Sorry for the late response. I was on vacation from there. In the end, the test was successful. The mistake I made was the following. To avoid the CORS error, I had to create a second website key. This website key replaces the original x-api key. Previously I had both an x-api key and an extra website key. This didn't work.
Many thanks again for the help.
Regards,
Berry
Sorry for the late response. I was on vacation from there. In the end, the test was successful. The mistake I made was the following. To avoid the CORS error, I had to create a second website key. This website key replaces the original x-api key. Previously I had both an x-api key and an extra website key. This didn't work.
Many thanks again for the help.
Regards,
Berry
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yoganandamuthaiah solution is perfect
If you want an SAP BTP or SAP Build Apps solution, you can of course use a destination and then you can use your original key.
Good luck on your project
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.