Example #1
0
        /// <summary>
        /// Consolidates all the arguments from uri query string and HTTP POST body (if any), as a single string of Command-line arguments.
        /// </summary>
        /// <param name="request">The HTTP request where the uri query string part of arguments will be extracted from. This is an extension method to HttpRequestMessage, when you use instance method syntax to call this method, omit this parameter.</param>
        /// <param name="argsFromBody">A set of raw arguments from HTTP POST body (JSON).</param>
        /// <param name="funcQuoteArgument">A transform function to apply to each raw argument.</param>
        /// <returns>A single string of Command-line arguments.</returns>
        public static string BuildCmdArguments(this HttpRequestMessage request, JToken argsFromBody, Func <string, string> funcQuoteArgument)
        {
            CmdArgumentsBuilder argsBuilder = new CmdArgumentsBuilder();

            return(argsBuilder.AddFromQueryString(request).Add(argsFromBody).ToString(funcQuoteArgument));
        }
Example #2
0
        /// <summary>
        /// Consolidates all the arguments from uri query string and HTTP POST body (if any), as a single string of Command-line arguments.
        /// </summary>
        /// <param name="request">The HTTP request where the uri query string part of arguments will be extracted from. This is an extension method to HttpRequestMessage, when you use instance method syntax to call this method, omit this parameter.</param>
        /// <param name="argsFromBody">A set of raw arguments from HTTP POST body.</param>
        /// <param name="funcQuoteArgument">A transform function to apply to each raw argument.</param>
        /// <returns>A single string of Command-line arguments.</returns>
        public static string BuildCmdArguments(this HttpRequestMessage request, IEnumerable <KeyValuePair <string, object> > argsFromBody, Func <string, string> funcQuoteArgument)
        {
            CmdArgumentsBuilder argsBuilder = new CmdArgumentsBuilder();

            return(argsBuilder.AddFromQueryString(request).Add(argsFromBody).ToString(funcQuoteArgument));
        }