title: how to make json request in haskell using wreq?
body: <p>I have a server which accepts json requests and they work fine with python client. I am trying to do the same thing in haskell.</p>
  
  <p>For instance my python client has following code</p>
  
  <pre><code>conn = JSONRPCProxy("XXX.XX.XX.XX", 5050, "2.0", 120)
  print conn.request('show_attrs', [{"shortcode":"CODEWORD1","fx":'CD2'}, ["?queryattr", "queryname"]]);
  </code></pre>
  
  <p>I want to send out the same query using haskell and get json back as result. Not worried about json parsing as of now!</p>
  
  <p>I tried Network.Wreq and it kinda works but always gives no response</p>
  
  <pre><code>data MyPriceRequest = MyRequestRequest { method::String,id::Int} deriving (Show,Generic)
  
  instance ToJSON MyPriceRequest
  r &lt;- post "http://IP.IP.IP.IP:port/" (toJSON (MyRequestRequest  "codeword" [""] 1))
  
  *** Exception: NoResponseDataReceived
  </code></pre>
  
  <p>I get exception but same code works with python</p>
  
  <p>In python it works with...</p>
  
  <pre><code>conn = JSONRPCProxy("IP.IP.IP.IP", port, "2.0", 120)
  print conn.request('codeword', []);
  </code></pre>