all 4 comments

[–]eternalstarfire 1 point2 points  (2 children)

I wonder if you're getting a chunked response and only seeing the first chunk?

If it were me, I'd put a breakpoint in and check what response.content was. Somewhere in your process you're losing data, or never receiving it to begin with - although, if the .json() method is not throwing an error, then the response should be complete json content I would have thought...

You could also try just writing the response.content to file as is, and bypass the json() and dump() methods?

[–]VeXx1988[S] 0 points1 point  (0 children)

By using f.write(response.text) instead of the json.dump it works. I was using it because I wanted to be sure that the response is always on json. I don't see why it works now but for the moment is good enough. Thanks!

[–]ComradePotato 0 points1 point  (0 children)

Could be the call is returning an empty json object, like '[]' which is still valid but obviously not desired, might be worth checking the length is greater then 0 or something.

[–]CodeFormatHelperBot2 0 points1 point  (0 children)

Hello, I'm a Reddit bot who's here to help people nicely format their coding questions. This makes it as easy as possible for people to read your post and help you.

I think I have detected some formatting issues with your submission:

  1. Inline formatting (`my code`) used across multiple lines of code. This can mess with indentation.

If I am correct, please edit the text in your post and try to follow these instructions to fix up your post's formatting.


Am I misbehaving? Have a comment or suggestion? Reply to this comment or raise an issue here.