Using HTTPClient to Integrate Backend Systems

If a secure connection vias HTTPS is established the used server certificate needs to be signed by one of the Salesforce B2C Commerce supported CAs and must not be self-signed. You might find it useful to create an HTTPClient to perform POSTS or DELETES, which are not supported by the WebDAVClient. There are no file size limits for HTTPClient.

The HTTPClient class supports the following HTTP methods:

Note: Because the B2C Commerce WebDAV client doesn't support POST or delete features, you might want to use HTTPClient within a secure HTTPS connection to post or delete files.
 var httpClient : HTTPClient = new HTTPClient();
 httpClient.setTimeout(2000);
 var message : String;
 httpClient.open('GET', 'http://www.myinstance.com/feed.xml');
 httpClient.send();

 if (httpClient.statusCode == 200)
 {
      message = httpClient.text;
 }
 else
 {
     // error handling
     message="An error occured with status code "+httpClient.statusCode;
 }