コード例 #1
0
ファイル: CmdRequestHttp.cs プロジェクト: tefarov/teo_core
        public static IBatchable Create(Input command, Environment.Environment env)
        {
            var    itm = new CmdRequestHttp();
            string enc = null, cfg = null;

            if (command.TrySet(ref cfg, 3, "config") ||
                command.TrySet(ref cfg, 3, "cfg"))
            {
                (new configurator(itm, cfg)).Configure();
            }

            if (!command.TrySet(ref itm.Page, name: "page"))
            {
                throw new ArgumentException("Webpage not specified");
            }

            command.TrySet(ref itm.Method, name: "method");
            command.TrySet(ref itm.Accept, name: "accept");
            command.TrySet(ref itm.ContentT, name: "contenttype");
            command.TrySet(ref itm.UserAgent, name: "useragent");

            decimal tme = 0;

            if (command.TrySet(ref tme, name: "timeout"))
            {
                itm.Timeout = (int)(tme * 1000);
            }

            // TODO: Parse encoding
            command.TrySet(ref enc, name: "encoding");

            return(itm);
        }
コード例 #2
0
ファイル: CmdRequestHttp.cs プロジェクト: tefarov/teo_core
 public configurator(CmdRequestHttp item, string filepath) : base(filepath)
 {
     ITM = item.NotNull();
 }
コード例 #3
0
ファイル: CmdRequestHttp.cs プロジェクト: tefarov/teo_core
 public ProcessorText(CmdRequestHttp item) : base(item)
 {
 }
コード例 #4
0
ファイル: CmdRequestHttp.cs プロジェクト: tefarov/teo_core
 public AResponseProcessor(CmdRequestHttp item)
 {
     ITM = item.NotNull();
 }