Exemplo n.º 1
0
        private HttpRequestMessage BuildRequest()
        {
            var method = _httpActionContext.HttpAction();

            switch (method)
            {
            case HttpActionType.GET:
                return(BuildGet());

            case HttpActionType.POST:
                return(BuildPost());

            case HttpActionType.PUT:
                return(BuildPut());

            case HttpActionType.PATCH:
                return(BuildPatch());

            case HttpActionType.DELETE:
                return(BuildDelete());

            default:
                throw new ArgumentException(string.Format("Unknown HTTP method ({0})", method), method.ToString());
            }
        }
Exemplo n.º 2
0
        private HttpRequestMessage BuildRequest()
        {
            HttpRequestMessage message = null;

            switch (_httpActionContext.HttpAction())
            {
            case HttpActionType.GET:
                message = BuildGet();
                break;

            case HttpActionType.POST:
                message = BuildPost();
                break;

            case HttpActionType.PUT:
                message = BuildPut();
                break;

            case HttpActionType.DELETE:
                message = BuildDelete();
                break;

            default:
                throw new Exception("should not have gotten here");
            }

            return(message);
        }
Exemplo n.º 3
0
        private HttpRequestMessage BuildRequest()
        {
            switch (_httpActionContext.HttpAction())
            {
            case HttpActionType.GET:
                return(BuildGet());

            case HttpActionType.POST:
                return(BuildPost());

            case HttpActionType.PUT:
                return(BuildPut());

            case HttpActionType.PATCH:
                return(BuildPatch());

            case HttpActionType.DELETE:
                return(BuildDelete());

            default:
                throw new Exception("should not have gotten here");
            }
        }