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
A previous release made it possible to find the status code when Web API returns an error (#517). I would now like to be able to parse the response body of the request when an error occurs.
It turns out Steam sometimes returns the same status code for different kinds of errors. The response body will contain a distinct message, though. For example, when calling ISteamUserStats/GetPlayerAchievements, Steam could respond with a 403 (Forbidden), which either means that the request was rate-limited, or it could mean that the player has a private profile. When the latter occurs, the response body looks like this:
{
"playerstats": {
"error": "Profile is not public",
"success": false
}
}
Can WebAPIRequestException or SteamKitWebRequestException be extended to include a KeyValue property for the response body?
The text was updated successfully, but these errors were encountered:
RudeySH
changed the title
Parse response when Web API returns an error?
Parse response body when Web API returns an error?
Nov 3, 2019
A previous release made it possible to find the status code when Web API returns an error (#517). I would now like to be able to parse the response body of the request when an error occurs.
It turns out Steam sometimes returns the same status code for different kinds of errors. The response body will contain a distinct message, though. For example, when calling
ISteamUserStats/GetPlayerAchievements
, Steam could respond with a 403 (Forbidden), which either means that the request was rate-limited, or it could mean that the player has a private profile. When the latter occurs, the response body looks like this:Can
WebAPIRequestException
orSteamKitWebRequestException
be extended to include aKeyValue
property for the response body?The text was updated successfully, but these errors were encountered: