/// <summary>
        ///     Sets or updates the user credentials (user name and password) in the URI.
        /// </summary>
        /// <param name="user">
        ///     The new value of the user.
        /// </param>
        /// <param name="password">
        ///     The new value of the password.
        /// </param>
        /// <returns>
        ///     A <see cref="FluentUriBuilder"/> instance to allow chaining.
        /// </returns>
        /// <exception cref="ArgumentNullException">
        ///     If either of the arguments specified is <c>null</c>.
        /// </exception>
        public FluentUriBuilder Credentials(string user, string password)
        {
            Precondition.NotNullOrWhiteSpace(user, nameof(user));
            Precondition.NotNullOrWhiteSpace(password, nameof(password));

            credentials = new UriCredentials(user, password);

            return(this);
        }
        /// <summary>
        ///     Sets or updates the user credentials (user name and password) in the URI.
        /// </summary>
        /// <param name="user">
        ///     The new value of the user.
        /// </param>
        /// <param name="password">
        ///     The new value of the password.
        /// </param>
        /// <returns>
        ///     A <see cref="FluentUriBuilder"/> instance to allow chaining.
        /// </returns>
        /// <exception cref="ArgumentNullException">
        ///     If either of the arguments specified is <c>null</c>.
        /// </exception>
        public FluentUriBuilder Credentials(string user, string password)
        {
            user.ThrowIfNullOrWhiteSpace(nameof(user));
            password.ThrowIfNullOrWhiteSpace(nameof(password));

            credentials = new UriCredentials(user, password);

            return this;
        }
Exemple #3
0
        /// <summary>
        ///     Sets or updates the user credentials (user name and password) in the URI.
        /// </summary>
        /// <param name="user">
        ///     The new value of the user.
        /// </param>
        /// <param name="password">
        ///     The new value of the password.
        /// </param>
        /// <returns>
        ///     A <see cref="FluentUriBuilder"/> instance to allow chaining.
        /// </returns>
        /// <exception cref="ArgumentNullException">
        ///     If either of the arguments specified is <c>null</c>.
        /// </exception>
        public FluentUriBuilder Credentials(string user, string password)
        {
            user.ThrowIfNullOrWhiteSpace(nameof(user));
            password.ThrowIfNullOrWhiteSpace(nameof(password));

            credentials = new UriCredentials(user, password);

            return(this);
        }
        /// <summary>
        ///     Removes the user name and password from the URI.
        /// </summary>
        /// <returns>
        ///     A <see cref="FluentUriBuilder"/> instance to allow chaining.
        /// </returns>
        public FluentUriBuilder RemoveCredentials()
        {
            credentials = new UriCredentials(string.Empty, string.Empty);

            return(this);
        }
        /// <summary>
        ///     Removes the user name and password from the URI.
        /// </summary>
        /// <returns>
        ///     A <see cref="FluentUriBuilder"/> instance to allow chaining.
        /// </returns>
        public FluentUriBuilder RemoveCredentials()
        {
            credentials = new UriCredentials(string.Empty, string.Empty);

            return this;
        }