title: POST request with JSON in Dispatch and Scala
body: <p>I'm having trouble making a POST request with a JSON object using Dispatch and Scala.</p>
  
  <p>The POST request works fine for sure since I tested it using curl:</p>
  
  <pre><code>~/workspace $ curl -vd 'tracker={"project":"campaign","event":"home","number":"100"}'  http://exampleurl:8145/test
  </code></pre>
  
  <p>and I get a HTTP 200 response as expected</p>
  
  <p>But when I try doing the same using Dispatch library ( <a href="http://dispatch.databinder.net/Dispatch.html" rel="nofollow">http://dispatch.databinder.net/Dispatch.html</a> ) like so:</p>
  
  <pre><code>scala&gt; Http(url("http://exampleurl:8145/test") &lt;&lt; "tracker={'project':'campaign','event':'home','number':'100'}" &gt;|)
  </code></pre>
  
  <p>this is what I get:</p>
  
  <pre><code>dispatch.StatusCode: Unexpected response code: 404
  Paramerter missing: [tracker] not found
  at dispatch.HttpExecutor$$anonfun$when$1.apply(executor.scala:53)
  at dispatch.HttpExecutor$$anonfun$when$1.apply(executor.scala:50)
  at dispatch.HttpExecutor$$anonfun$x$2.apply(executor.scala:41)
  at dispatch.HttpExecutor$$anonfun$x$2.apply(executor.scala:36)
  at dispatch.BlockingHttp$$anonfun$execute$1.apply(Http.scala:54)
  at dispatch.Http.pack(Http.scala:25)
  at dispatch.BlockingHttp$class.execute(Http.scala:53)
  at dispatch.Http.execute(Http.scala:21)
  at dispatch.HttpExecutor$class.x(executor.scala:36)
  at dispatch.Http.x(Http.scala:21)
  at dispatch.HttpExecutor$class.when(executor.scala:50)
  at dispatch.Http.when(Http.scala:21)
  at dispatch.HttpExecutor$class.apply(executor.scala:60)
  at dispatch.Http.apply(Http.scala:21)
  at .&lt;init&gt;(&lt;console&gt;:11)
  at .&lt;clinit&gt;(&lt;console&gt;)
  at .&lt;init&gt;(&lt;console&gt;:11)
  at .&lt;clinit&gt;(&lt;console&gt;)
  at $print(&lt;console&gt;)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  at java.lang.reflect.Method.invoke(Method.java:597)
  at scala.tools.nsc.interpreter.IMain$ReadEvalPrint.call(IMain.scala:704)
  at scala.tools.nsc.interpreter.IMain$Request.loadAndRun(IMain.scala:914)
  at scala.tools.nsc.interpreter.IMain.loadAndRunReq$1(IMain.scala:546)
  at scala.tools.nsc.interpreter.IMain.interpret(IMain.scala:577)
  at scala.tools.nsc.interpreter.IMain.interpret(IMain.scala:543)
  at scala.tools.nsc.interpreter.ILoop.reallyInterpret$1(ILoop.scala:694)
  at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:745)
  at scala.tools.nsc.interpreter.ILoop.command(ILoop.scala:651)
  at scala.tools.nsc.interpreter.ILoop.processLine$1(ILoop.scala:542)
  at scala.tools.nsc.interpreter.ILoop.loop(ILoop.scala:550)
  at scala.tools.nsc.interpreter.ILoop.process(ILoop.scala:822)
  at scala.tools.nsc.interpreter.ILoop.main(ILoop.scala:851)
  at xsbt.ConsoleInterface.run(ConsoleInterface.scala:57)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  at java.lang.reflect.Method.invoke(Method.java:597)
  at sbt.compiler.AnalyzingCompiler.call(AnalyzingCompiler.scala:57)
  at sbt.compiler.AnalyzingCompiler.console(AnalyzingCompiler.scala:48)
  at sbt.Console.console0$1(Console.scala:23)
  at sbt.Console$$anonfun$apply$2$$anonfun$apply$1.apply$mcV$sp(Console.scala:24)
  at sbt.TrapExit$.executeMain$1(TrapExit.scala:33)
  at sbt.TrapExit$$anon$1.run(TrapExit.scala:42)
  </code></pre>
  
  <p>I'm not sure why it's missing the tracker parameter that I'm trying to pass through.</p>
  
  <p>Thoughts anyone?</p>