urschrei / pyzotero

Pyzotero: a Python client for the Zotero API
https://pyzotero.readthedocs.org
Other
908 stars 99 forks source link

HTTP response is stored in Zotero.request property #149

Open johndoe46 opened 2 years ago

johndoe46 commented 2 years ago

Platform: Darwin/arm64 Python version: 3.9.4 Pyzotero version: 1.5.1

Problem Description

More Details

If possible, paste the full traceback in a code block below, and fill in the summary

Traceback from pyzotero import zotero zot = zotero.Zotero("xxxxxx", "group", "zzzzzzzz") zot.items(q="something", start=0, limit=10) # fetching the response header "Total-results" from a public # property called "request" total_results = zot.request.headers.get("Total-Results", 0) print(total_results) # is actually a print(type(zot.request)
    from pyzotero import zotero
    zot = zotero.Zotero("xxxxxx", "group", "zzzzzzzz")
    zot.items(q="something", start=0, limit=10)
    # fetching the response header "Total-results" from a public
    # property called "request"
    total_results = zot.request.headers.get("Total-Results", 0)
    print(total_results)
    # is actually a <class 'requests.models.Response'>
    print(type(zot.request))

Zotero.request should be named Zotero.response