()
| 156 | |
| 157 | // Ties to parse the response body into a JSON Object |
| 158 | private JsonObject parseJson() { |
| 159 | if (isJson()) { |
| 160 | return new JsonParser().parse(getBody()).getAsJsonObject(); |
| 161 | } |
| 162 | return null; |
| 163 | } |
| 164 | |
| 165 | // Checks if the response is likely to be JSON. |
| 166 | private boolean isJson() { |