4

I am quite new to python and Flask and in a recent code review I had quite interesting conversation about using the json package to parse a json response. My code was simply doing this:

return json.loads(response.text)

The suggested change was actually asking for move to a more convinient

return response.json()

using the request package.

Not sure what should really be the outcome of thsi change. Any manual and example found online use the json library.

Can someone halp me to understand the main difference (if it exist) ?

Thanks for your help.

davidism
  • 98,508
  • 22
  • 317
  • 288
vertigo
  • 41
  • 1

0 Answers0