Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP response is stored in Zotero.request property #149

Open
johndoe46 opened this issue Feb 25, 2022 · 0 comments
Open

HTTP response is stored in Zotero.request property #149

johndoe46 opened this issue Feb 25, 2022 · 0 comments
Assignees

Comments

@johndoe46
Copy link

johndoe46 commented Feb 25, 2022

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

Problem Description

  • What were you trying to do: trying to get the total results for a query. had to fetch it from the HTTP response that is stored in the request property
    • What API call did it involve: search with q
    • What error was raised: no error, just bad naming

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants