I am trying to request from an end-point deployed on firebase cloud functions, the endpoint basically uses perplexity API to generate a response then send it to the client.
cloud functions: uses axios post to the perplex api setting the auth with bearer api and app/json
Frontend Client:
fetch with a method POST using the function url and body: JSON.Stringify…….
I kept getting cannot set headers after sent to client and a axios 400. Not sure what’s going on..
the code supposes to send the response to the client in json format.
Steven Liu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.