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
The method Collection.action is meant to allow access to the ArangoDB HTTP endpoints that do not have a dedicated method in Collection. However, the method always sends an empty request body. Here's the code:
def action(self, method, action, **params):
"""a generic fct for interacting everything that doesn't have an assigned fct"""
fct = getattr(self.connection.session, method.lower())
r = fct(self.getURL() "/" action, params = params)
return r.json()
In the fourth line above, the session's HTTP method is called without a data argument. Everything aside from the URL is passed to the HTTP method through the params argument, which the method would treat as an additional keyword argument, leaving data with its default value (which is None). Consequently, none of the POST or PUT endpoints work using this method (I was trying to use the PUT /_api/collection/{collection-name}/properties endpoint when I discovered this error).
To fix the issue, params['data'] should be passed to the data argument, and the rest of params should be passed as kwargs.
The text was updated successfully, but these errors were encountered:
The method
Collection.action
is meant to allow access to the ArangoDB HTTP endpoints that do not have a dedicated method inCollection
. However, the method always sends an empty request body. Here's the code:In the fourth line above, the
session
's HTTP method is called without adata
argument. Everything aside from the URL is passed to the HTTP method through theparams
argument, which the method would treat as an additional keyword argument, leavingdata
with its default value (which isNone
). Consequently, none of thePOST
orPUT
endpoints work using this method (I was trying to use thePUT /_api/collection/{collection-name}/properties
endpoint when I discovered this error).To fix the issue,
params['data']
should be passed to thedata
argument, and the rest ofparams
should be passed as kwargs.The text was updated successfully, but these errors were encountered: