This is my updated class
public class ConvertCurrencyWS
{
public class ResponsWS
{
String id;
String quote;
}
public void getConvertCurrency()
{
Http h = new Http();
HttpRequest req = new HttpRequest();
req.setEndPoint('http://gturnquist-quoters.cfapps.io/api/random');
req.setMethod('GET');
HttpResponse resp = h.send(req);
//return resp.getBody();
String resstring = resp.getBody();
ResponsWS r = (ResponsWS)JSON.deserialize(resstring,ResponsWS.class);
System.debug('Response is '+resstring);
System.debug('The quote is '+r.Id+' '+r.quote);
}
}
Q :
It works but the json serializing is not happening somehow as because the second debug returns as "null" for both the id & quote as shown below.
Can someone tell me why both the values are returning as null ?