You need to sign in to do that
Don't have an account?
MRITYUNJAY PATEL 3
Hi Everyone,
why showing variable not exist. give me solution
//This is my code
global class JsonParseringClass
{
public static void getJSONData()
{
HTTP http = new HTTP();
HTTPRequest request = new HTTPRequest();
request.setEndpoint('https://jsonplaceholder.typicode.com/posts');
request.setMethod('GET');
HTTPResponse response = http.send(request);
string res = response.getBody();
system.debug(response.getStatus());
List<BlogWrapper> blogObj = ( List<BlogWrapper>)JSON.deserialize(res, List<BlogWrapper>.class);
System.debug('Respone- ' + blogObj.id);
System.debug('Respone- ' + blogObj.userId);
System.debug('Respone- ' + blogObj.title);
System.debug('Respone- ' + blogObj.body);
//return blogObj;
}
global class BlogWrapper
{
public Integer userId { get; set; }
public Integer id { get; set; }
public string title { get; set; }
public string body { get; set; }
}
}
Thanks in advance
i want to debug specific field of list.
Hi Everyone,
why showing variable not exist. give me solution
//This is my code
global class JsonParseringClass
{
public static void getJSONData()
{
HTTP http = new HTTP();
HTTPRequest request = new HTTPRequest();
request.setEndpoint('https://jsonplaceholder.typicode.com/posts');
request.setMethod('GET');
HTTPResponse response = http.send(request);
string res = response.getBody();
system.debug(response.getStatus());
List<BlogWrapper> blogObj = ( List<BlogWrapper>)JSON.deserialize(res, List<BlogWrapper>.class);
System.debug('Respone- ' + blogObj.id);
System.debug('Respone- ' + blogObj.userId);
System.debug('Respone- ' + blogObj.title);
System.debug('Respone- ' + blogObj.body);
//return blogObj;
}
global class BlogWrapper
{
public Integer userId { get; set; }
public Integer id { get; set; }
public string title { get; set; }
public string body { get; set; }
}
}
Thanks in advance
Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you
All Answers
Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you
Please try the below code:-
Please mark it as Best Answer if it helps you.
Thanks & Regards
Suraj Tripathi