You need to sign in to do that
Don't have an account?
Matt Metros
Retrieving XML from RSS feed and displaying that in lightning Component
public static List<Dom.XMLNode> search(String remoteSiteURL, String query)
{
String url = remoteSiteURL + EncodingUtil.urlEncode(query, 'UTF-8');
Http h = new Http();
HttpRequest req = new HttpRequest();
// url that returns the XML in the response body
req.setEndpoint(url);
req.setMethod('GET');
HttpResponse res = h.send(req);
Dom.Document doc = res.getBodyDocument();
Dom.XMLNode rss = doc.getRootElement();
}
I am not sure if I need to convert this into JSON.
{
String url = remoteSiteURL + EncodingUtil.urlEncode(query, 'UTF-8');
Http h = new Http();
HttpRequest req = new HttpRequest();
// url that returns the XML in the response body
req.setEndpoint(url);
req.setMethod('GET');
HttpResponse res = h.send(req);
Dom.Document doc = res.getBodyDocument();
Dom.XMLNode rss = doc.getRootElement();
}
I am not sure if I need to convert this into JSON.
You can just try the url in the browser and see what response you can get.