VMware Cloud Community
ar33
Contributor
Contributor

Ignore content type response when using vCACCAFERestClient and parse as string

Hello,

I am attempting to make a request to the Content Service API in vRA and return the XaaS custom form to parse out the available values in the fields. As the response is text/yaml, vRO is throwing an error saying it cannot find a HttpMessageConverter for the response type of text/yaml.

Is there anyway to force the request and receiving the response as just a string?

Here is the code:

var endpoint = 'com.vmware.csp.core.content.service.api';

var restClient = vcacHost.createRestClient(endpoint);

var url = "/contents/{form-guid}/data";

var response = restClient.get(url);

And the error message:
Could not extract response: no suitable HttpMessageConverter found for response type [class java.lang.Object] and content type [text/yaml;charset=UTF-8]


Thank you for your help!

0 Kudos
1 Reply
xian_
Expert
Expert

How about using the content management client?

var client = vcacHost.createContentManagementClient()

var response = client.get("tenants/dev/blueprints/44097902-ff8c-40d5-894f-5f41a9153c8b")

0 Kudos