How to return binary payload using apigee

Hi

We have a blocker scenario in our project. One of the use - cases is to generate a pdf. The Target server returns a binary object (/octet-stream) . I am getting the payload using the Assign Message policy in the {message.content} . The API gives 200 and response is returned but the pdf is corrupted and does not open.

However when the Target server is directly involved bypassing the APIGEE proxy endpoint then it works fine and pdf is generated and opened successfully.

I am not doing anything with the response I receive from the target server and hence at a loss to understand why the pdf is corrupted when coming from APIGEE.

Can someone please help. We are into pre-prod and we are stuck. We do not have a porbable solution on this. Is there a limitation for returning binary data like pdf using APIGEE ? What is the solution for such use cases. Kindly help urgently.

@Dino

@Dino-at-Google

Regards

Nilanjan


0 5 1,171
5 REPLIES 5

This is now resolved. I have removed the Assign message policy in case of Binary data and returned the raw response from the target server to the client.

@Dino

@Dino-at-Google

Simple proxy should work ..Don’t do assignment but just pass thru..

Client -> Apigee -> make a call to target and respond back with out any assignment..


Make sure target is sending appropriate content type headers back to apigee..out side that it should work..


Share error details for further troubleshoot if required but you should solve it..

Streaming is to manage large payload. In your case enable at response should improve performance..


https://docs.apigee.com/api-platform/develop/enabling-streaming

As i stated , that is exactly what i had done and it was resolved. But thats for the input anyways.

Not applicable

you can also enable streaming, by deafult streaming is done in binary.

I believe it is enabled by default for binary. We dont need to do anything. Anyways it works. 🙂