title: SyntaxError: Unexpected token v in JSON at position 2
body: <p>I am running a node.js server running express.js on my local machine and need to decode a request made by the client, that contains a json string in it. I run the code below and get the following error. </p>
  
  <pre><code>SyntaxError: Unexpected token v in JSON at position 2
      at JSON.parse (&lt;anonymous&gt;)
      at C:\myLocation\source\repos\server\server\server.js:144:19
      at Layer.handle [as handle_request] (C:\myLocation\source\repos\server\server\node_modules\express\lib\router\layer.js:95:5)
      at trim_prefix (C:\myLocation\source\repos\server\server\node_modules\express\lib\router\index.js:317:13)
  </code></pre>
  
  <p>My request is </p>
  
  <blockquote>
    <p><a href="http://localhost:1337/%7B%22Code%22:%22VNdVwY9iWhFZ114CjcDZbY%22,%22Chat%22:%22Test.txt%22%7D" rel="nofollow noreferrer">http://localhost:1337/%7B%22Code%22:%22VNdVwY9iWhFZ114CjcDZbY%22,%22Chat%22:%22Test.txt%22%7D</a></p>
  </blockquote>
  
  <p>The expected json is</p>
  
  <blockquote>
    <p>{"Code":"VNdVwY9iWhFZ114CjcDZbY","Chat":"Test.txt"}</p>
  </blockquote>
  
  <p>I get the json, but it still gives me the same error.</p>
  
  <p>My code:</p>
  
  <pre><code>app.use(function (req, res) {
      //console.log(req.url)
      var myStr = req.url.replace('/', '')
  
      if (myStr != false) {
          let decodeStr = decodeURIComponent(myStr)
  
          var test = JSON.parse(decodeStr)
          var json = JSON.stringify(test)
  
          if (json.includes(createkey)) {
              console.log("Create: " + json)
              createFile(req, res, test)
          } else if (json.includes(modKey)) {
              console.log("Modify: " + json)
              modifyFile(req, res, test)
          } else if (json.includes(readFileKey)) {
              console.log("Read: " + json)
              readFile(req, res, test)
          }
      } else {
          res.sendStatus(404)
          console.log("home")
      }
  })
  </code></pre>
  
  <p>Why do I get the error?</p>
  
  <p><strong>Edit 1</strong></p>
  
  <p>I added <code>console.log(decodeStr)</code>but I still get the error. It returns <code>{"Code":"VNdVwY9iWhFZ114CjcDZbY","Chat":"Test.txt"}</code></p>