Sample Code:
HTTP h = new HTTP();
HTTPRequest req = new HTTPRequest();
req.setEndPoint( ‘<Enter Endpoint URL>’ );
req.setMethod( ‘GET’ );
req.setHeader( ‘Authorization’, ‘Bearer <Enter Token>’ );
HTTPResponse res = h.send( req );
String str = res.getBody();
HTTP h = new HTTP();
HTTPRequest req = new HTTPRequest();
req.setEndPoint( ‘<Enter Endpoint URL>’ );
req.setMethod( ‘GET’ );
req.setHeader( ‘Authorization’, ‘Bearer <Enter Token>’ );
HTTPResponse res = h.send( req );
String str = res.getBody();