+ 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...