Beispiel #1
0
        public static Task <K> APIRequestAsync <K>(Tuple <string, string>[] getParameters, Tuple <string, string>[] postParameters)
            where K : Response
        {
            var path = RequestPath.GetRequestPath <K>();
            //TODO: Custom paths? Appropriate subdomain paths? Not sure.
            //Maybe store custom path in the requestpath.path itself?

            var requestUri = SlackClient.GetSlackUri(Path.Combine(APIBaseLocation, path.Path), getParameters);
            var request    = (HttpWebRequest)HttpWebRequest.Create(requestUri);

            //This will handle all of the processing.
            var state = new RequestStateForTask <K>(request, postParameters);

            return(state.Execute());
        }