Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide WebAPI method to retrieve full JSON response #200

Open
Yeggstry opened this issue Mar 11, 2013 · 0 comments
Open

Provide WebAPI method to retrieve full JSON response #200

Yeggstry opened this issue Mar 11, 2013 · 0 comments

Comments

@Yeggstry
Copy link

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants