Flutter web CORS issue for google place API's in flutter web - flutter

How can I resolve CORS issue in 3rd party API's.
--ERROR XMLHttpRequest error.
onError:Exception: Error==========XMLHttpRequest error.
[]
Using this API for to get the the short names of places;
https://maps.googleapis.com/maps/api/place/details/json?place_id=ChIJrTF9CPptqDsRVgqHeuvWQvU&key=xxxxxxxx
Since I was not able to get shortnames from any plugins, so used this api, but which is working perfect in mobile not working on web.

Related

How to authenticate against an OpenID authorization server in Flutter?

I'd like to consume a REST service secured with OpenID from a Flutter client targetting Android, iOS and web.
I found flutter_appauth package, but it seems not compatible with web apps.
Is there any Flutter OpenID package working on all platforms?
I'd be happy with a full web solution (something using system browser and deep links).

CORS issue when running ionic project on android and browser

I am having an ionic 3 project which is accessing remote url. However when i run the project on browser with "ionic serve" or on android emulator/device using "ionic cordova build android" command I am getting this following error :
Fetch API cannot load API URL.
Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. Origin 'http://localhost:8080' is therefore not allowed access.
I googled and found that this is CORS issue which occurs when one domain tries to access other domain, but the project works properly on other 2 machine on same network.
The database in use is couchDB.
You have to enable specific origins on the server that are allowed the access it.
The Ionic Team has also written a nice summary about CORS related to Ionic: Ionic Cors Documentation
First, check if your external API have SSL protection means it's Https instead of Http. And if it is Https and still you are getting the error then use below plugin instead of fetch() or Angular HttpClient.
https://ionicframework.com/docs/native/http

Which Google Analytics Api client library-node or javascript to use for my website?

I am making a website which displays report generated using google analytics data.My frontend is in React JS and backend in Node js and I have used the create-react-app boilerplate for React.I am really confused as to which client library -Node or Javascript to use for my website.Please could someone help me out..I am really confused.
Google Analytics has 2 API's for getting reporting data: the core api v3 and the reporting api v4. For new projects I would suggest using the latest reporting api v4.
To use any of these api's I would use Google's officially supported Node.js client library: google-api-nodejs-client
I also wrote a complete guide on how to work with Node.js and the Google Analytics Reporting API. This will definitely help you get started.

How to use CORS with grails rest API?

I am developing Rest Api using grails. It is working on localhost:8080. when I am calling with POSTMAN it responded with json. I want to use this data and also perform CRUD operation on my web page which is running on other domain. When I am trying to call RESTAPI which is written in grails, the browser is not able to get a response due to Access-Control-Allow-Origin. So how to enable CORS functionality in my REST API, So anyone can access from a different domain.
If you are using Grails 3.2.1 or higher, it comes with CORS support built in.
In your application.yml, add the following:
grails:
cors:
enabled: true
See http://docs.grails.org/latest/guide/introduction.html#whatsNewCors for further details.

Github API v3 giving 404 errors

Im using Joomla platform JGithub to communicate with Github API v3.
The code are all ok and i was able to use all GET methods (getComment etc).
But all POST, DELETE methods are failing with 404 error with a message Nothing Found.
Am just using username and password for authentication (No Oauth and stuff..)
Any idea why this error might be.
Another Joomla code was able to do this with the same script.
This is what confusing me.