Esempio n. 1
0
        private static void HandlePostRequests(HttpActionExecutedContext actionExecutedContext, CompoundDocument transformed)
        {
            if (actionExecutedContext.Request.Method != HttpMethod.Post)
            {
                return;
            }

            var primaryResourceHref = transformed.GetPrimaryResourceHref();

            if (String.IsNullOrEmpty(primaryResourceHref))
            {
                return;
            }

            actionExecutedContext.Response.Headers.Location = new Uri(primaryResourceHref);
            actionExecutedContext.Response.StatusCode       = HttpStatusCode.Created;
        }