If we do a GET request that expects a JSON response, like so:
${response}= RequestsLibrary.GET ${url}
then if the server returns 204 (no content) instead of returning JSON, we get this error:
Replacing variables from keyword return value failed: Resolving variable '${response.json()}' failed: JSONDecodeError: Expecting value: line 1 column 1 (char 0)
I think it'd be nice to have a friendly error message for this. Perhaps something like Expected the response to contain JSON, but the response was 204 (No Content) 🙂
If we do a GET request that expects a JSON response, like so:
then if the server returns 204 (no content) instead of returning JSON, we get this error:
I think it'd be nice to have a friendly error message for this. Perhaps something like
Expected the response to contain JSON, but the response was 204 (No Content)
🙂