Skip to content

How to change HTTP Method #444

Answered by Tratcher
itsme112358 asked this question in General
Discussion options

You must be logged in to vote

While we've set up the basic request transform infrastructure, we haven't yet implemented some of the rules you'd expect like method transforms.

Luckily this scenario is easy to work around in code:

                endpoints.MapReverseProxy(proxyPipeline =>
                {
                    proxyPipeline.Use((context, next) =>
                    {
                        if (HttpMethods.IsPut(context.Request.Method))
                        {
                            context.Request.Method = HttpMethods.Post;
                        }

                        return next();
                    });
                    proxyPipeline.UseProxyLoadBalancing();
                });

Inter…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@itsme112358
Comment options

Answer selected by Tratcher
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants