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
Lorenz AlexisLorenz Alexis 

How to send pageRedirect after HttpGet request?

How can I send a pageRedirect from a @HttpGet global static String doGet() {} ???
NagendraNagendra (Salesforce Developers) 
Hi,

If you have requirement of a call-out to internal Salesforce URL  Use your code as:
Http h = new Http();
HttpRequest webReq = new HttpRequest();
webReq.setMethod('GET');
webReq.setHeader('Authorization','Bearer '+UserInfo.getSessionId());
// replace endpoint url
webReq.setEndpoint('https://na12.salesforce.com/udd/Site/siteDashboard.apexp');
HttpResponse res = h.send(webReq);
System.debug(' ------ '+res.getbody());
Basically request need to be out, organized. That is why you were redirected to the page. I assume that you have already added endpoint URL in remote site setting of the organization.

Thanks,
Nagendra