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
At the moment, the following two lines have to be called when retrieving the full JSON response:
String data = getJSON(apiInterface, method, version, params);
JSONObject jsonData = new JSONObject(data);
I have refactored this out into a new method in WebAPI (getJSONResponse) so that only one line is required. Since this can be used for other WebAPI calls, I thought it made sense to provide it as a separate pull request rather than providing it in the ISteamUserStats changes.
Unfortunately the getJSONData method is not suitable for all WebAPI calls. For example, a bad GetServersAtAddress call returns the error detail as "message", not "statusDetail" as expected.
Whilst this is ultimately a flaw with the WebAPI response setup itself, I have resorted to retrieving the full JSON response and to handle any error response within the builder itself (see the buildPlayerAchievements in UserStatsBuilder).
The text was updated successfully, but these errors were encountered:
At the moment, the following two lines have to be called when retrieving the full JSON response:
I have refactored this out into a new method in WebAPI (getJSONResponse) so that only one line is required. Since this can be used for other WebAPI calls, I thought it made sense to provide it as a separate pull request rather than providing it in the ISteamUserStats changes.
Unfortunately the getJSONData method is not suitable for all WebAPI calls. For example, a bad GetServersAtAddress call returns the error detail as "message", not "statusDetail" as expected.
Whilst this is ultimately a flaw with the WebAPI response setup itself, I have resorted to retrieving the full JSON response and to handle any error response within the builder itself (see the buildPlayerAchievements in UserStatsBuilder).
The text was updated successfully, but these errors were encountered: