Question about KNIME REST API Response Type 'Mason Object' (accept: application/vnd.mason+json)


I am calling the KNIME REST API.
By the way, I want to receive the Response Media Type as an ‘application/json’, not an ‘application/vnd.mason+json’.

Although ‘Accept: application/json’ was set on the Request Header side, the REST API Response continues to be received as Mason Object.

Below is an example of setting the header to ‘Accept: application/json’ and calling the REST API.

As you can see, Response is received as a Mason Object.
Even if you set the Media Type to ‘application/json’ in the Swagger UI and call REST API, the results are the same.

Is there any way to receive REST API results correctly in application/json?

1 Like

Hi @pigret113

technically, a mason object is also a valid json object, so I’m guessing this was a convenient way to offer both response types.
However, if you don’t want to fiddle with the response, you can additionally to the Accept: application/json header also set Prefer: representation=minimal.

Kind regards

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.