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
MarrisMarris 

HTTP callout doubt

Hi,

 

         I had a HTTP callout, In that can I send the HTTP request as a PDF file from attachment object to my site?

 

         If possible how can i do it here in below code. Can anyone help me?

 HttpRequest req = new HttpRequest();
        HttpResponse res = new HttpResponse();
        Http http = new Http();
        
        userId = userInfo.getUserId();
        orgId = userInfo.getOrganizationId();
        
        String URL = 'https://sample.com?&orgid='+orgid+'&userid='+Userid;
        System.debug('URL is:'+URL);
        req.setMethod('GET');
        req.setEndpoint(URL);
        req.setbody(?)
        req.setHeader('content-type','text/html');
        
        system.debug(req.getMethod());
        system.debug(req.getEndpoint());
        system.debug(req.getbody());
        
        try {res = http.send(req);}

 

   Thanks

   Marris.