0

I have an post request API that returns stdClass object as response. I'm using firebase cloud function in Javascript and I tried to use response.json() but it gets error "Converting circular structure to JSON" so I need to convert or do something on stdClass object to array or json. Is there any solution for this?

5
  • 2
    Can you show the output? Commented Mar 9, 2020 at 10:59
  • I can't see the ouput cuz if I try .json() , it gets an error and if i just send response i get {"size":0,"timeout":0} Commented Mar 9, 2020 at 11:03
  • but from the documentation for this API output must be something like this.. Commented Mar 9, 2020 at 11:04
  • [company] => stdClass Object( [testrentcar] => stdClass Object ( [trip] => Array ( [0] => stdClass Object ( [code] => 2 ) Commented Mar 9, 2020 at 11:06
  • Check this answer stackoverflow.com/questions/16062824/… Commented Mar 9, 2020 at 12:42

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.