Describe the behavior:
When a request is made with PyCap that results in a 500 Internal Server Error response, PyCap's _RCRequest.get_content does not handle this error; instead, with format_type="csv"|"xml", an empty string from response.text is silently returned, and with format_type="json", a requests.exceptions.JSONDecodeError('Expecting value: line 1 column 1 (char 0)') is raised due to response.text being an empty string.
Expected behavior:
The expected behavior would be to detect a 500 code in the request response and emit an informative error from get_content.
Desktop:
- OS: Ubuntu 20.04.5 LTS x86_64
- REDCap version 12.4.7
- PyCap Version 2.4.0