You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I pass keys=["A_KEY"] or key it makes a GET request. The keys or key get added to the query string like so:
aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request', (...)/_view/by_configuration_type?key=access_point_configuration&include_docs=true
(...)/_view/by_configuration_type?keys=access_point_configuration&include_docs=true
# After testing with curl this is the error returned by those requests:
{"error":"bad_request","reason":"invalid UTF-8 JSON"}
The correct way of sending those requests would be:
I think there are two issues. Internally, in these functions, keys and ids is used interchangeably. The second issue is, how params are url encoded in the GET request. Maybe deciding on either POST or GET requests internally would reduce the surface to implement stuff.
Hope this helps, if I got something wrong please let me know.
The text was updated successfully, but these errors were encountered:
conduct0
changed the title
Fetching docs in view by key parameter naming
Fetching docs in view by key/keys parameter
Jan 9, 2025
Hey,
thank you for the work in this library.
I run into a small issue while querying documents in a view by key. Since there are no docs yet I will quote the code. I use Couchdb v. 3.1.1
The problem happens In the View class in view.py where some methods like ids and docs are made available.
In
ids
method we have keys parameter. In that case we fetch with POST as described in the couchdb docs. This works.In
docs
method we have ids parameter instead of keys like above. If I put keys in ids param it works as above.If I pass keys=["A_KEY"] or key it makes a GET request. The keys or key get added to the query string like so:
The correct way of sending those requests would be:
I think there are two issues. Internally, in these functions,
keys
andids
is used interchangeably. The second issue is, how params are url encoded in the GET request. Maybe deciding on either POST or GET requests internally would reduce the surface to implement stuff.Hope this helps, if I got something wrong please let me know.
The text was updated successfully, but these errors were encountered: