Layer7 API Management

  • 1.  How to handle html and images in an xml body

    Posted Jul 03, 2016 11:00 AM

    We have a requirement - where in a response from a end point returns an xml payload to the gateway ( routing response returned to the api gateway ) . In the xml body , we have html and images ( format gif ) that both need to be decoded and handled. Is there any specific content type that I should be setting to handle the html , image portions in the xml rrouting esponse from the end point coming back into the api gateway ?

     

    We are on version 9.0 of the api gateway.



  • 2.  Re: How to handle html and images in an xml body
    Best Answer

    Broadcom Employee
    Posted Aug 21, 2016 11:35 PM

    If the html or image in a xml element, I would expect it's encoded, such as base64 encode. Then you can use xpath assertion to get the encoded string, and then decode it accordingly.

    Otherwise, the response should return those contents in MIME multi-part format. Then you may use ${response.parts.x} to get the binary data, and ${response.parts.x.body} to get the text data.