CURLRequest Class Failed to parse json string |
I am using CURLRequest class, to receive data from an API, sometimes I get this message
Code: <b>Fatal error</b>: Uncaught CodeIgniter\Format\Exceptions\FormatException: Failed to parse json string, error: "Malformed UTF-8 characters, possibly incorrectly encoded". in /Users/userName/Sites/MySite/vendor/codeigniter4/framework/system/Format/JSONFormatter.php:41 followed by the stack trace I understand the message, even if the returned json does not depend on me but on the API, is there a way to still be able to see what is returned from the API in order to understand the problem and possibly report the problem to the API manager?
Add dd() to see the variable before the line of the error.
https://codeigniter4.github.io/CodeIgnit...ng.html#dd
(11-17-2022, 05:55 PM)kenjis Wrote: Add dd() to see the variable before the line of the error. but the error line of the JSONFormatter.php file?
PHP Code: dd(); What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
I'm still here, i tried to put
PHP Code: dd() and also PHP Code: dd(); before line 41 where the error is reported, but I don't see anything. I set the value of CI_DEBUG to true as the guide says, but my toolbar is disabled for ajax calls. What am I doing wrong?
Pass the variable you want to see to dd().
|
Welcome Guest, Not a member yet? Register Sign In |