Skip to content

Commit

Permalink
Leave null WebAPI args defined but empty
Browse files Browse the repository at this point in the history
  • Loading branch information
azuisleet committed Apr 28, 2019
1 parent 6bb5554 commit 49f3382
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Samples/6.WebAPI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ static void Main( string[] args )
// you can call interface functions through a Call method
using ( WebAPI.Interface steamNews = WebAPI.GetInterface( "ISteamNews" ) )
{
Dictionary<string, object> newsArgs = new Dictionary<string,object>();
Dictionary<string, object> newsArgs = new Dictionary<string, object>();
newsArgs[ "appid" ] = "440";

KeyValue results = steamNews.Call( "GetNewsForApp", /* version */ 1, newsArgs );
Expand Down
8 changes: 6 additions & 2 deletions SteamKit2/SteamKit2/Steam/WebAPI/WebAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,13 @@ async Task<KeyValue> CallAsyncCore( HttpMethod method, string func, int version
string key = HttpUtility.UrlEncode( kvp.Key );
string value;

if ( kvp.Value is byte[] )
if ( kvp.Value == null )
{
value = HttpUtility.UrlEncode( kvp.Value as byte[] );
value = string.Empty;
}
else if ( kvp.Value is byte[] buffer )
{
value = HttpUtility.UrlEncode( buffer );
}
else
{
Expand Down

0 comments on commit 49f3382

Please sign in to comment.