Getting API response in text/plain format

I am using the integration block for getting a custom API call.
in that, I am getting the response in text/plain format (content-type: text/plain;)
but as the custom API block need a response in JSON format that’s why I am getting error like this
“ERROR”:{ 1 item
“message”: “src property must be a valid json object”

how can i get the response in text/plain format instead of JSON
or can i convert the plain/text into the Content-Type:applciation/json??
if yes than how???

Custom API Block seems expect JSON response only from API. So, your API need to support JSON response and if it does not support JSON, there are no way to convert. (request and response happens between VF and API, VF supports only JSON, your API supports only text, there’s no chance to convert in the middle.)

Thanks @kun432

What if i use the custom code block?

If i make api call using the custom code block and store response in the variable.

Is this work???

Can i get api response in plain/text format using custom code block?

Recently, requireFromURL function, which you can import external libraries, has implemented in Custom Code Block. So, I tried Axios, which is HTTP client library, but it does not work.

seems requireFromURL cannot import all the libraries such as npm modules. It depends on the structure of modules and also there seems some limitations. I think this is for importing simple utilitiy modules such as text filtering, etc.
If you are interested, you can try.

okay, thanks for the info. @kun432