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 

Will HTTP request handle HTTPS URL?

Hi all,

 

Can http request handle https URL in the request body? Does it show any eror while sending request/receiving response.

 

 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.setHeader('content-type','text/html');
        
        system.debug(req.getMethod());
        system.debug(req.getEndpoint());
        system.debug(req.getbody());
        
        try {res = http.send(req);}

Whether it produce any error in future. 

 

Thanks

  Marris

InternalServerErrorInternalServerError

Yes in can handle secure connections. You should be able to see any error in the logs.

JitendraJitendra

Yeah, it would definitely work...