-
-
Notifications
You must be signed in to change notification settings - Fork 204
Open
Description
We have APIs that return base64 encoded content.
I want to write a script to decode base64 response, like this.
def on_response(response: httpx.Response, posting: Posting) -> None:
if response is None or response.status_code != 200:
return
r = json.loads(response.content)
if r["data"] is None or r["data"]["content"] is None:
return
resp_decode = base64.b64decode(r["data"]["content"])
r["data"]["real_content"] = resp_decode
posting.notify("Content: {}".format(r["data"]["real_content"]))
response.__setattr__("content", resp_decode)
return None
But it has an error:
Error running on_response script
property 'content' of 'Response' object has no setter
Metadata
Metadata
Assignees
Labels
No labels