Skip to content

Instantly share code, notes, and snippets.

View sfdcfanboy's full-sized avatar

sfdcFanBoy sfdcfanboy

View GitHub Profile
HttpRequest req = new HttpRequest();
req.setEndpoint('https://my_endpoint.example.com/some_path');
req.setMethod('GET');
// Because we didn't set the endpoint as a named credential,
// our code has to specify:
// - The required username and password to access the endpoint
// - The header and header information
String username = 'myname';
HTTPRequest feedRequest = new HTTP Request();
feedRequest.setEndpoint('callout:SalesforceNC/services/data/v32.0');
feedRequest.setMethod('GET');
HTTP http = new HTTP();
HTTPResponse feedResponse = http.send(feedRequest);
System.debug(feedResponse.getBody());