BattlelogMobile.Client.ViewModel.MainViewModel.ConstructPostData C# (CSharp) Method

ConstructPostData() private static method

Create and encode login POST data
private static ConstructPostData ( string email, string password, SupportedGame game ) : string
email string
password string
game SupportedGame
return string
        private static string ConstructPostData(string email, string password, SupportedGame game)
        {
            // TODO: Combine params maybe?!
            string postData = null;
            Dictionary<string, string> postParams;

            if (game == SupportedGame.Battlefield3)
            {
                postParams = new Dictionary<string, string>
                    {
                        {"redirect", "|bf3|"},
                        {"email", email},
                        {"password", password},
                        {"remember", "0"},
                        {"submit", "Sign in"}
                    };
            }
            else
            {
                postParams = new Dictionary<string, string>
                    {
                        {"redirect", "|bf4|"},
                        {"email", email},
                        {"password", password},
                        {"remember", "0"},
                        {"submit", "Log in"}
                    };
            }
            foreach (var param in postParams)
            {
                if (postData != null)
                    postData += "&";
                postData += HttpUtility.UrlEncode(param.Key) + "=" + HttpUtility.UrlEncode(param.Value);
            }

            return postData;
        }