0

Im trying to consume an external API from Firebase Clouds Functions and i cant reach the url of the api, how can i make it read the url, and make the post method to ask for the data im needing to display.

thanks.

  • Are you getting any specific error? Also, are you on a paid version of Firebase? You need to be on at least the Flame Plan in order to have outbound networking in Cloud Functions. – smashed-potatoes May 16 '19 at 22:00
  • when i´m trying to do it on browser it says CORS policy error, then i moved into a cloud function, but no methods let me bind it with the url and sends the headers. And no, free plan, just for testing how it reacts with external apis – Jorge Daniel May 16 '19 at 22:04
  • 2
    You can't make outgoing requests to non-google controlled endpoints on the free plan. – Doug Stevenson May 16 '19 at 22:32
  • Possible duplicate of [Google Cloud functions call URL hosted on Google App Engine](https://stackoverflow.com/questions/52526521/google-cloud-functions-call-url-hosted-on-google-app-engine) – Renaud Tarnec May 17 '19 at 07:44
  • See also https://stackoverflow.com/questions/54275148/how-to-fetch-a-url-with-google-cloud-functions-request/54276070#54276070 – Renaud Tarnec May 17 '19 at 07:44
  • @DougStevenson yea i just saw that thanks – Jorge Daniel May 20 '19 at 14:48

0 Answers0