Handle Application/pdf, Application/json response in Connect-Rest
I'm hitting an API that returns a pdf(content-type : application/pdf) as a binary stream if everything goes well. In case of any exceptions, the API returns response in json format(content-type : application/json). How can I create a response class structure that can handle both type of responses?
I checked pyResponseAttachmentPage page and it's blank. When I try to do this using integration wizard, I get following error for pdf response :
Sample data list:The response data is not recognized as JSON or XML and cannot be saved. |