You need to sign in to do that
Don't have an account?

Erro: The method parse(String) is undefined for the type JSON
Hi All,
DefaultHttpClient client = new DefaultHttpClient();
HttpPost oauthPost = new HttpPost(baseUrl);
HttpResponse response = client.execute(oauthPost);
int code = response.getStatusLine().getStatusCode();
Map<String, String> oauthLoginResponse = (Map<String, String>) JSON.parse(EntityUtils
.toString(response.getEntity()));
eclipse show the error The method parse(String) is undefined for the type JSON
plz need help
sridevi,
Check out the documentation on the Apex JSON method, there is no "parse" method- http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_json.htm I think what you need is one of the deserialize methods there.
Sridevi is using JAVA code .Thats surely not apex
You can refer the below to know about java JSON parsing.
Link :- https://www.tutorialspoint.com/json/json_java_example.htm
In case you find any other issue please mention.
If you find your Solution than mark as this as a best answer.
Thanks and Regards
Suraj Tripathi.