title: Pentaho HTTP Post using JSON
body: <p>I'm brand new to Pentaho and I'm trying to do the following workflow:</p>
  
  <ul>
  <li>read a bunch of lines out of a DB</li>
  <li>do some transformations</li>
  <li>POST them to a REST web service in JSON</li>
  </ul>
  
  <p>I've got the first two figured out using an input step and the Json Output step.</p>
  
  <p>However I have two problems doing the final step:</p>
  
  <p>1) I can't get the JSON formatted how I want.  It insists on doing <code>{""=[{...}]}</code> when I just want <code>{...}</code>.  This isn't a big deal - I can work around this since I have control over the web service and I could relax the input requirements a bit.  (Note: this page <a href="http://wiki.pentaho.com/display/EAI/JSON+output" rel="nofollow">http://wiki.pentaho.com/display/EAI/JSON+output</a> gives an example for the output I want by setting <code>no. rows in a block=1</code> and an empty JSON block name, but it doesn't work as advertised.)</p>
  
  <p>2) This is the critical one.  I can't get the data to POST as JSON.  It posts as <code>key=value</code>, where the key is the name I specify in the HTTP Post field name (on the 'Fields' tab) and the value is the encoded JSON.  I just want to post the JSON as the request body.  I've tried googling on this but can't find anyone else doing it, leading me to believe that I'm just approaching this wrong.  Any pointers in the right direction?</p>
  
  <p>Edit: I'm comfortable scripting (in Javascript or another language) but when I tried to use XmlHttpRequest in a custom javascript snippet I got an error that XmlHttpRequest is not defined.</p>
  
  <p>Thanks!</p>