Layer7 API Management

 View Only
  • 1.  Binary responses are not returned by the APIGW

    Posted Oct 28, 2020 03:38 PM
      |   view attached
    We have an endpoint that returns binary response when called directly, please find the screen shot of the response returned by the endpoint when called directly for your reference. When this service is called thru APIGW, the ${response.mainpart} is empty, however, printing the following response variable in the audit, I do see some object reference in response.parts.1 as shown:
    response.parts.1= com.l7tech.common.mime.k@3e69d52b
    response.parts.1.message=
    response.parts.1.body=
    response.parts.1.contentType= application/octet-stream
    response.parts.1.size= 40906

    Question:
    1. How to get response from an endpoint that returns binary value?
    2. How to extract the object value from com.l7tech.common.mime.k@3e69d52b  (this was returned by response.parts.1 variable)

    Any inputs on how to resolve the same would be greatly appreciated.

    THanks
    Muthu



  • 2.  RE: Binary responses are not returned by the APIGW
    Best Answer

    Broadcom Employee
    Posted Oct 29, 2020 12:11 PM
    Hello Muthu,

    Your endpoint is returning a binary response in your screen show because the client is sending Accept  application/octet-stream in the header. 

    What is it you are trying to do with the binary response?  

    The gateway does not view content-type application/octet-stream as text so it will attempt to treat it differently. If you add in the cluster wide property contentType.otherTextualTypes with the value of application/octet-stream then you will see the binary message. but not sure if your actually want to do this.

    Barry





  • 3.  RE: Binary responses are not returned by the APIGW

    Posted Oct 29, 2020 02:51 PM
    Thanks a lot Barry for your response.  This is essentially an attachment consists of many files.

    Yup, that was it, I found out from other post yesterday. 

    This worked.