0

I'm using python's requests library and from it the response can be obtained either in bytes or In Unicode. I want to the difference between them, when to use the response in Unicode or in bytes. And how to interconvert them.

data=requests.get('http://ws.audioscrobbler.com/2.0/?method=geo.gettopartists&country=spain&api_key=f202d54c37859d31e6fb579da4c3b408&format=json').text

data=requests.get('http://ws.audioscrobbler.com/2.0/?method=geo.gettopartists&country=spain&api_key=f202d54c37859d31e6fb579da4c3b408&format=json').content

what is the difference between either of them and when should use one over other?

sjakobi
  • 3,546
  • 1
  • 25
  • 43

0 Answers0