Closed ngocngoan closed 3 weeks ago
Hey @ngocngoan Thanks for the in depth troubleshooting and recommended fix, that really helps! I understand that you are experiencing an issue when sending a POST to Graylog using the send_post_request
function.
I have no problem implementing your recommend fix, and thanks for providing that. I am curious though as to what intention you have with fetching /api/entitylists/preferences/saved-searches
from Graylog as we are not currently leveraging this Graylog endpoint within CoPilot. Could you think of a use case where it would make sense to add some frontend support for the API endpoint of /api/entitylists/preferences/saved-searches
?
Describe the bug When I send an HTTP POST request to the Graylog API /api/entitylists/preferences/saved-searches, then the error happens:
To Reproduce Steps to reproduce the behavior:
response = await send_post_request( endpoint="/api/entitylists/preferences/saved-searches", data=preferences.model_dump(by_alias=True, exclude_unset=True, mode="json"), )
Screenshots
The response text is empty string. It is the reason why the
response.json()
command generates the above error.Screenshots
Expected behavior
Update line 168 from
response.json()
toresponse.json() if response.text else None
Container Logs