You need to sign in to do that
Don't have an account?
vijaya kudupudi
System.JSONException: Malformed JSON: Expected '{' at the beginning of object
I am getting System.JSONException: Malformed JSON: Expected '{' at the beginning of object exception when i am trying to call callouts in my test class. I used the link (https://developer.salesforce.com/blogs/developer-relations/2013/03/testing-apex-callouts-using-httpcalloutmock.html) to call callouts in my test class. Please Anybody can give solution.
And in reality you should probably have more information in JSON since you get more data back than just the name. Also, I would suggest that you deactivate that API key and generate a new one since you put your API key publicly on the internet.
All Answers
NOTE: When adding code please use the "Add a code sample" button (icon <>) to increase readability and make it easier to reference.
Thanks for your reply. Here is the code for mock.
And in reality you should probably have more information in JSON since you get more data back than just the name. Also, I would suggest that you deactivate that API key and generate a new one since you put your API key publicly on the internet.
Thank you for your reply. Now my code is covered, I got good code coveragre. Thanks for your suggestion.