How to change HTTP Method #444
-
Hi! "Match": {
"Path": "/example/{id}/further/path",
"Method": "PUT"
},
"Transforms": [
{"PathPattern": "/further('{id}')/DifferentEndpoint"},
{
"HttpContext": {
"Method": "POST"
}
}
] "Transforms": [
{"PathPattern": "/further('{id}')/DifferentEndpoint"},
{
"HttpContext": {
"Method": "POST"
}
}
] Both configurations start without problems and redirct correctly according to the pattern. I just cannot figure out how to configure the request method so that it gets updated/overwritten/replaced. Any help would be appreciated greatly :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
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();
}); Interested in helping add this transform? I've filed #445 for this. |
Beta Was this translation helpful? Give feedback.
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:
Inter…