Ability to Configure Expected Status Code w/ REST Driver Method Configuration

Idea ID 2807929

Ability to Configure Expected Status Code w/ REST Driver Method Configuration

In the REST driver configuration, under subscriber options, you can configure different resources and associated methods that your driver will pass in driver-operation-data. What is not configurable are the HTTP status codes that should be considered a successful response. One example is when calling an  HTTP Post (add event) the driver expects 201 because that is the RESTful convention. However many APIs that I build drivers for do not always align perfectly to this convention creating the need to write custom policy to handle certain error status as a success. Similarly, I've seen modifies that we call return a 201 and get an error status as well.

It would be nice to be able to configure a list of status codes or better yet, a regular expression of what we expect to get as a response in the method configuration rather than trying to write policy to go around the default behavior (similar to configuring status codes to retry).

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.