title: API call from CURL to Node
body: <p>I'm working on an API that lets me test my request string online and gives me a <code>curl</code> statement (so far pretty standard).</p>
  
  <p>The issue is that I can't put that curl into a Node.js code.</p>
  
  <p>Here's the curl:</p>
  
  <pre><code>curl -X GET --header "Accept: application/json" --header "Authorization: Bearer &lt;my_key_here&gt;" "https://api.&lt;api_name&gt;.com/stations?limit=20&amp;searchstring=cancun*"
  </code></pre>
  
  <p>I tried to use <code>Postman</code> to parse that url, but no success.</p>
  
  <p>The company doesn't provide a module (to my knowledge) that I can call from the Node.js script.</p>
  
  <p>I'm following the Node.js <code>requests</code> page for my .js file.
  <a href="https://nodejs.org/api/http.html#http_http_request_options_callback" rel="nofollow noreferrer">https://nodejs.org/api/http.html#http_http_request_options_callback</a></p>
  
  <pre><code>var request = require('request');
  
  request({
  url: 'https://api.&lt;api_name&gt;.com/stations',
  
  headers: {
      'Accept': application/json,
      'Authorization: Bearer': &lt;my_key&gt;
  }
  </code></pre>