title: Testing REST routes with curl --data, returns 404
body: <p>I am attempting a MEAN stack tutorial and I am at the "<a href="https://thinkster.io/mean-stack-tutorial/#opening-rest-routes-testing-the-initial-routes" rel="nofollow">Testing the Initial Routes</a>" step, where we test our REST routes using cURL.</p>
  
  <p>I am trying to run this command to create a new post:</p>
  
  <pre><code>curl --data 'title=test&amp;link=http://test.com' http://localhost:3000/posts
  </code></pre>
  
  <p>However, I keep getting errors. At first the error was:</p>
  
  <pre><code>curl: no URL specified!
  curl: try 'curl --help' or 'curl --manual' for more information
  'link' is not recognized as an internal or external command,
  operable program or batch file.
  </code></pre>
  
  <p>Then after some SO purusing, I found that I needed to use double quotes since I am on windows. However, I'm still getting an error:</p>
  
  <pre><code>&lt;h1&gt;Not Found&lt;/h1&gt;
  &lt;h2&gt;404&lt;/h2&gt;
  &lt;pre&gt;Error: Not Found
  at app.use.res.render.message (c:\base\demo\thinkster-mean-tutorial\flapper-news\app.js:30:13)
  at Layer.handle [as handle_request] (c:\base\demo\thinkster-mean-tutorial\flapper-news\node_modules\express\lib\router\layer.js:82:5)
  at trim_prefix (c:\base\demo\thinkster-mean-tutorial\flapper-news\node_modules\express\lib\router\index.js:302:13)
  at c:\base\demo\thinkster-mean-tutorial\flapper-news\node_modules\express\lib\router\index.js:270:7
  at Function.proto.process_params (c:\base\demo\thinkster-mean-tutorial\flapper-news\node_modules\express\lib\router\index.js:321:12)
  at next (c:\base\demo\thinkster-mean-tutorial\flapper-news\node_modules\express\lib\router\index.js:261:10)
  
  at c:\base\demo\thinkster-mean-tutorial\flapper-news\node_modules\express\lib\router\index.js:603:15
  at next (c:\base\demo\thinkster-mean-tutorial\flapper-news\node_modules\express\lib\router\index.js:246:14)
  
  at Function.proto.handle (c:\base\demo\thinkster-mean-tutorial\flapper-news\node_modules\express\lib\router\index.js:166:3)
  at router (c:\base\demo\thinkster-mean-tutorial\flapper-news\node_modules\express\lib\router\index.js:35:12)&lt;/pre&gt;
  </code></pre>
  
  <p>I tried running the next command in the tutorial:</p>
  
  <pre><code>curl http://localhost:3000/posts
  </code></pre>
  
  <p>This resulted in the exact same error. Then I checked the url in my browser and it is actually: <a href="http://localhost:3000/#/posts" rel="nofollow">http://localhost:3000/#/posts</a>. So I tried running the above command but with the # url and it returned the html for that page. So then I tried running the initial command with the # url but I got the same error. </p>
  
  <p>Not sure what to try next. I followed the tutorial exactly and even went back and copy/pasted code to make sure I had it exactly correct but I'm still getting an error.</p>