python - typeerror 'bytes' object is not callable -


my code:

import psycopg2 import requests urllib.request import urlopen import urllib.parse uname = " **** " pwd = " ***** " resp = requests.get("https://api.flipkart.net/sellers/skus/skuid/listings", auth=(uname, pwd)) con_page = resp.content() print (con_page) 

i getting error:

traceback (most recent call last):  file "c:\users\prime\documents\netbeansprojects\fp_api\src\fp_api.py", line 18, in <module>      con_page = resp.content()  typeerror: 'bytes' object not callable 

based on documentation, return value of requests.get() requests.response, has content field type bytes, rather content() method.

try instead:

con_page = resp.content 

Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -