Can't override the proxy method in a js middleware


Using Tyk API Gateway v3.1.2, I’ve an endpoint configured to proxy to another webservice with a custom javascript middleware (post) in the middle.
In the middleware, I’ve been able to override the body (request.Body), the path (request.URL), but not the method (request.Method) (the host in the definition width override_target).
I would like to override a POST method width request.Method = “PATCH”; but it does not work.

I’ve tried to use “method_transforms” in the endpoint definition, but it doesn’t work (maybe because of the custom middleware).

Hi @jossensei,

Have you tried to use the “method_transforms” without the middleware as a test?

If it works then, could you share your API definition.