Ejemplo n.º 1
0
        public static async Task <Stream> RequestReturnStream(string url, SHttpMethod method, double timeout = 20000, bool isNotCache = false)
        {
            SService.< RequestReturnStream > d__4 variable = new SService.< RequestReturnStream > d__4();
            variable.url        = url;
            variable.method     = method;
            variable.timeout    = timeout;
            variable.isNotCache = isNotCache;
            variable.< > t__builder = AsyncTaskMethodBuilder <Stream> .Create();

            variable.< > 1__state = -1;
            variable.< > t__builder.Start <SService.< RequestReturnStream > d__4>(ref variable);
            return(variable.< > t__builder.get_Task());
        }
Ejemplo n.º 2
0
        public static async Task <string> RequestReturnString(string url, SHttpMethod method, List <KeyValuePair <string, string> > parameters = null, bool isNotCache = false)
        {
            SService.< RequestReturnString > d__5 variable = new SService.< RequestReturnString > d__5();
            variable.url        = url;
            variable.method     = method;
            variable.parameters = parameters;
            variable.isNotCache = isNotCache;
            variable.< > t__builder = AsyncTaskMethodBuilder <string> .Create();

            variable.< > 1__state = -1;
            variable.< > t__builder.Start <SService.< RequestReturnString > d__5>(ref variable);
            return(variable.< > t__builder.get_Task());
        }
Ejemplo n.º 3
0
        public static HttpMethod GetHttpMethod(SHttpMethod method)
        {
            switch (method)
            {
            case SHttpMethod.Get:
            {
                return(HttpMethod.Get);
            }

            case SHttpMethod.Post:
            {
                return(HttpMethod.Post);
            }

            case SHttpMethod.Put:
            {
                return(HttpMethod.Put);
            }
            }
            return(HttpMethod.Delete);
        }