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
-
2Can you show the output?lucas– lucas2020-03-09 10:59:53 +00:00Commented 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}Pood– Pood2020-03-09 11:03:22 +00:00Commented Mar 9, 2020 at 11:03
-
but from the documentation for this API output must be something like this..Pood– Pood2020-03-09 11:04:33 +00:00Commented Mar 9, 2020 at 11:04
-
[company] => stdClass Object( [testrentcar] => stdClass Object ( [trip] => Array ( [0] => stdClass Object ( [code] => 2 )Pood– Pood2020-03-09 11:06:09 +00:00Commented Mar 9, 2020 at 11:06
-
Check this answer stackoverflow.com/questions/16062824/…ajorquera– ajorquera2020-03-09 12:42:39 +00:00Commented Mar 9, 2020 at 12:42
Add a comment
|