Open YoniMelki opened 2 years ago
@YoniMelki, why are you replacing the response content with a httpx.Response
object? Should this function just erase the content of the original response?
def scrub_malware_bazaar_sample_response(response: dict):
response.update({"content": httpx.Response(status_code=200)})
return response
At the point of this update, the original httpx.Response
was already serialized and the "content"
was supposed to contain a UTF-8 string. Your code says you have a response whose content contains a nested response object. We would never get a real HTTP response like that.
@boechat107 So how would you suggest to do? I still wants all the fields of the response
Hi! First of all, I wanted to thank you for this package and also for the new support to httpx!
I think that we should support a JSON serializer for recorded responses. Here is some code with YAML first:
When running the test below, everything works fine and we indeed succeed to update the key
content
with an httpx object here is how it looks:However, when changing the serializer to JSON, we get an exception with the following traceback:
I think that we should support binary data for JSON responses as well.
Thank you!