Using HTTPClient to Integrate Backend Systems

Use the HTTPClient class to create an HTTP client.

The HTTPClient class supports the following HTTP methods:

Important:

For security reasons, we recommend that you always use HTTPS when connecting to external servers. A Certificate Authority (CA) that B2C Commerce recognizes must sign the certificate at the external server. You can import additional CAs in Business Manager. See Import Certificates for an Instance.

 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;
 }
X Privacy Update: We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used. By continuing to use this site you are giving us your consent to do this. Privacy Policy.