title: Express 4 - Url rewrite module functionality similar to IIS
body: <p>I am looking to get some requests made to a certain url path intercepted and then be forwarded onto a different end point.</p>
  
  <p>I have done similar things using IIS and their rewrite module, so I'm looking to achieve the same with Express.</p>
  
  <p>So far I have a route handler setup like so:</p>
  
  <pre><code>app.all('/api/*', function(req, res) {
      var options = {};
      options.uri = req.url.replace('/api/', 'http://some.apiendpoint.com/v1');
      request(options, function(err, response, body){
        res.send(body);
      });
  });
  </code></pre>
  
  <p>As you can see I use the request object to make the re-routed call to my other api end point and send on the response body back to the client.</p>
  
  <p>This works fine for me for a GET request, but as I see in the request docs, GET is used as the default when no action type is supplied in options.</p>
  
  <p>So, is there a way when using the request object, to make it perform a request using the request as is incoming to the route handler (the req param)? That way whatever headers have already been set, post params, etc, are just passed along in the request call?</p>
  
  <p>Sorry if I'm not making a lot of sense here, I just don't want to be sniffing out the request type, params, headers etc, in the original request to then repackage into suitable options in the request object.</p>