title: How do I pass a req.setHeaders method on res.redirect method within the same app.get function?
body: <pre><code>var express = require('express');
  var app = express();
  
  var PORT = process.env.PORT;
  
  app.get('/', function(req, res){
     res.json('Enter your query parameters for an image search like so: https://api.cognitive.microsoft.com/bing/v5.0/images/search?q=cats&amp;count=10 and for the latest search results enter the url ttps://api.cognitive.microsoft.com/bing/v5.0/images/*'); 
  });
  </code></pre>
  
  <blockquote>
    <p>Here is the app.get method where I want to get parameters input by the user and then redirect it to the bing api to return search results for an image search. The big api requires an API key to be passed into the header, like so Ocp-Apim-Subscription-Key: ••••••••••••••••••••••••••••••••. 
    How do I do this? </p>
  </blockquote>
  
  <pre><code>app.get('/imagesearch/:image*', function(req, res){
      console.log(req.params.image);
      console.log(req.query.count);
      res.redirect('https://api.cognitive.microsoft.com/bing/v5.0/images/search?q='+req.params.image+'&amp;count='+req.query.count);
  });
  
  app.listen(PORT, function(){
     console.log('Express listening on: '+PORT); 
  });
  </code></pre>