function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sridevisridevi 

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

Platy ITPlaty IT

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.

Mohith Kumar ShrivastavaMohith Kumar Shrivastava

Sridevi is using JAVA code .Thats surely not apex

Suraj Tripathi 47Suraj Tripathi 47
Hi sridevi,
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.