Posted: 6 Mar 2017 10:27 EST Last activity: 14 Mar 2017 11:12 EDT
Testing Connect-REST with POST method
We have an external REST service which has GET method disabled and only POST is supported. This is verified with SoapUI as well (with a distinct error message on GET method).
When clicking Test Connection button in the Connect-REST service, it will always default to GET method (as seen in pyTestConnectivity activity) with no option to test other methods (explicitly referencing httpRequest = new com.pega.apache.http.client.methods.HttpGet(endpointURL.toString() ). Is it possible somehow to test connectivity with other methods? The nature of REST API is that it has distinct and well defined methods, so it would be quite limiting to force test connectivity to only 1 out of 4 methods (GET/POST/PUT/DELETE).
***Updated by moderator: Lochan to add Categories***
We are on 7.1.8, and yes you can configure your Connect-REST method to use POST and call some activity which you have to go and create, however this defeats the purpose of the Test Connection button. Putting this in perspective, if you have a "test" feature which only checks if the URL is accessible to the application server, then it can be a common feature to test if URL is accessible (not specific for a service type). There are many cases where URL is just simply inaccessible due to firewall restrictions. However, in our case, the GET method is disabled by the service provider, so if we were to issue a GET method invocation, we would get a different error code than if we were to use POST.