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
case = api.find_first(query=query, sort=['-title'], range='all')
# This will fail
# print(case.json())
# This works
print(case)
Possible Solutions
Two options:
Change documentation to say that the returned object is a dict of the case description.
Change the returned object to be of type requests.Response.
Complementary information
Currently the first matched case is returned by selecting the first element in the JSON array returned by the search API. Would it make more sense to instead set the range parameter to range='0-1'?
Happy to submit a PR for this, if a solution is decided upon.
The text was updated successfully, but these errors were encountered:
Bug
Work Environment
Problem Description
api.find_first()
function should, according to doc strings return arequests.Response
object. It however returns a regular Python dict.Relevant lines in code: https://github.com/TheHive-Project/TheHive4py/blob/1.x/thehive4py/api.py#L433-L439
Steps to Reproduce
Possible Solutions
Two options:
requests.Response
.Complementary information
Currently the first matched case is returned by selecting the first element in the JSON array returned by the search API. Would it make more sense to instead set the range parameter to
range='0-1'
?Happy to submit a PR for this, if a solution is decided upon.
The text was updated successfully, but these errors were encountered: