Response hook response not modified

Hi,

I have created a python plugin that tries to modify the response (under the responsehook). All goes well, and printing the new response.body contains the needed modificaitons. But when getting the response on the client (Postman), the modificaitons are not reflected. Any idea what is wrong? See part of the code below. Is is right to modify the response.body directly? Or should I do something else?

# finalResponse contains the new response body
response.body = json.dumps(finalResponse)
tyk.log("ResponseHook2 final final response: {0}".format(response.body), "info")
return response
1 Like

Problem solved, it seems that I have to replace the rawbody (as binary) instead of the body itself

Hi Juan
Thanks for letting the Community know that you solved it :metal: