GooglePlayInstant/Editor/QuickDeploy/OAuth2Server.cs
/// <summary>
/// Returns a key/value pair corresponding to the code or error response present in the query, and throws
/// an ArgumentException when the query is not valid.
/// For a query to be valid:
///     1. The query representing authorization response should consist of a single query parameter
///     2. The single query parameter should be an equals-separated key/value pair
///     3. The key for the single query parameter should be either "code" or "error"
/// </summary>
Returns a key/value pair corresponding to the code or error response present in the query, and throws
an ArgumentException when the query is not valid.
For a query to be valid:
1. The query representing authorization response should consist of a single query parameter
2. The single query parameter should be an equals-separated key/value pair
3. The key for the single query parameter should be either "code" or "error"
Returns a key / value pair corresponding to the code or error response present in the query and throws an ArgumentException when the query is not valid . For a query to be valid : 1 . The query representing authorization response should consist of a single query parameter 2 . The single query parameter should be an equals - separated key / value pair 3 . The key for the single query parameter should be either " code " or " error "
internal static KeyValuePair<string, string> GetCodeOrErrorResponsePair(string query)
        {
            var paramPairs = query.Split('&');
            if (paramPairs.Length != 1)
            {
                throw new ArgumentException(string.Format("Unexpected number of URI parameters {0}",
                    paramPairs.Length));
            }
            var keyAndValue = paramPairs[0].Split('=');
            if (keyAndValue.Length != 2)
            {
                throw new ArgumentException(string.Format("URI parameter pair has {0} components", keyAndValue.Length));
            }
            var key = keyAndValue[0];
            var value = Uri.UnescapeDataString(keyAndValue[1]);
            if (key != "code" && key != "error")
            {
                throw new ArgumentException(string.Format("Unexpected URI parameter key \"{0}\"", key));
            }
            return new KeyValuePair<string, string>(key, value);
        }
internal static KeyValuePair < string , string > GetCodeOrErrorResponsePair ( string query ) { var paramPairs = query . Split ( ' ' ) ; if ( paramPairs . Length != 1 ) { throw new ArgumentException ( string . Format ( " " , paramPairs . Length ) ) ; } var keyAndValue = paramPairs [ 0 ] . Split ( ' ' ) ; if ( keyAndValue . Length != 2 ) { throw new ArgumentException ( string . Format ( " " , keyAndValue . Length ) ) ; } var key = keyAndValue [ 0 ] ; var value = Uri . UnescapeDataString ( keyAndValue [ 1 ] ) ; if ( key != " " && key != " " ) { throw new ArgumentException ( string . Format ( " \" \" " , key ) ) ; } return new KeyValuePair < string , string > ( key , value ) ; }
Returns a key/value pair corresponding to the code or error response present in the query, and throws
an ArgumentException when the query is not valid.
Returns a key / value pair corresponding to the code or error response present in the query and throws an ArgumentException when the query is not valid .
// The authorization response should consist of a single query parameter. // The single query parameter should be an equals-separated key/value pair. // The key for the single query parameter should either be "code" or "error".
query
string