Salesforce | How to access php code in salesforce apex class

Author - Webner

We can access the php code in salesforce using @future(callout=true/false). The function we make for accessing the php code in apex class is of static type and does not return any value.


public static void function_Name()
  //variable declaration
          Http h = new Http();
          HttpRequest req = new HttpRequest();
          HttpResponse res = new HttpResponse();
          String url =”//Path for the php code”;
          res = h.send(req);
          String response  = res.getBody();
    catch(exception e)
       system.debug('Save file to server exception :'+e);

Webner Solutions is a Software Development company focused on developing Insurance Agency Management Systems, Learning Management Systems and Salesforce apps. Contact us at for your Insurance, eLearning and Salesforce applications.

Leave a Reply

Your email address will not be published. Required fields are marked *