You need to sign in to do that
Don't have an account?
Trying to read external web page
I'm trying to read an external web page into my VF page. This is the code that I am trying to run, however I get a login screen instead of the web page content.
public with sharing class MyController {
public String valueOne { get; set; }
public String valueTwo { get; set; }
public String page {get; set;}
public PageReference DownloadUrl(){
System.debug('Reached Here');
HttpRequest req = new HttpRequest();
req.setEndpoint('http://www.google.com');
req.setMethod('GET');
Http http = new Http();
HTTPResponse res = http.send(req);
//page = res.getBody();
System.debug(res.getBody());
return null;
}
}
Can someone take a look and please let me know if I am missing something?
Thanks.