title: Posting string causes express body-parser to throw SyntaxError
body: <p>I have the following simplified code:</p>
  
  <pre><code>'use strict'
  
  const express = require('express')
  const bodyParser = require('body-parser')
  const app = express()
  app.use(bodyParser.json())
  
  
  const storage = {}
  
  app.get('/', (req, res) =&gt; {
    res.send()
  })
  
  app.get('/ping', (req, res) =&gt; {
    res.send('pong')
  })
  
  ;[
    'mycollection'
  ].forEach((collection) =&gt; {
    storage[collection] = []
  
    app.get(`/${collection}`, (req, res) =&gt; {
      console.log('GET /' + collection)
      return res.send(storage[collection])
    })
    app.post(`/${collection}`, (req, res) =&gt; {
      console.log('POST /' + collection)
      const item = req.body
      if (!item) return res.status(400).send({ message: 'Invalid body' })
      storage[collection].push(item)
      res.status(201).send({ message: 'Successfully added.' })
    })
  })
  const port = process.env.PORT || 3000
  console.log('---&gt; Running on port', port)
  app.listen(port)
  </code></pre>
  
  <p>When I perform this request:</p>
  
  <pre><code>curl -X POST -H "Content-Type: application/json" -d '"test"' "http://localhost:3000/mycollection"
  </code></pre>
  
  <p>This gives me the following error:</p>
  
  <pre><code>SyntaxError: Unexpected token # in JSON at position 0
  </code></pre>
  
  <p>But <code>"test"</code> is valid JSON. </p>
  
  <pre><code>$ node
  &gt; JSON.parse('"test"')
  &gt; "test"
  </code></pre>