/cc iiliev
I'm sort of at an impasse here and learning as I go about the REST plug-in within vRO (with which I have no prior experience). We have here some basic code very kindly provided by a colleague which creates a transient REST session and performs auth via username and password. It fails with "This operation is not supported for NONE".
var restBaseUrl = "https://server.domain.com"; var requestUrlString = "/api/v1/XXX/YYY/" ; var authUsername = "service-account-name"; var authPassword = "service-account-password"; var returnArray; var restHost = RESTHostManager.createHost("MyRequest"); var transientHost = RESTHostManager.createTransientHostFrom(restHost); transientHost.url = restBaseUrl; var request = transientHost.createRequest("GET", requestUrlString, ""); request.setHeader("Accept", "application/json"); var response; response = request.executeWithCredentials(authUsername, authPassword); var statusCode = response.statusCode;
Everything before line 12 runs just fine, however after enabling debugging in vRO I can see the trace where it fails calling the executeWithCredentials method and I'm just not sure why. I've run some tests and have written out the attributes of the RESTRequest to ensure it's properly formatted, and it is. I'm not sure how I can continue troubleshooting this, however. Is it possible that executeWithCredentials only works for secure string type as input parameters? Any pointers would be appreciated.
vRO 7.3
HTTP-REST plug-in 2.2.2