title: Paypal Rest API keeps returning malformed json error
body: <p>I am trying to create payment using <code>paypal</code> Rest API, but I keep getting this error response:</p>
  
  <pre><code>{"name":"MALFORMED_REQUEST","message":"The request JSON is not well formed.","information_link":"https://developer.paypal.com/webapps/developer/docs/api/#MALFORMED_REQUEST","debug_id":"262cbdc417df7"}
  </code></pre>
  
  <p>here with my code:</p>
  
  <pre><code>payment_url = 'https://api.sandbox.paypal.com/v1/payments/payment'
  headers = {"Content-Type": "application/json", "Authorization": "Bearer %s" % access_token}
  data = {
          "intent": "sale",
          "redirect_urls": {
              "return_url": "http://localhost:8080/index.html",
              "cancel_url": "http://localhost:8080/index.html"
          },
          "payer": {
              "payment_method": "paypal"
          },
          "transactions": [
              {
                  "amount": {
                      "total": "7.47",
                      "currency": "USD"
                  },
                  "details": {
                      "subtotal": "7.41",
                      "tax": "0.03",
                      "shipping": "0.03"
                  },
                  "description": "This is the payment transaction description.",
                  "item_list": {
                      "items": [
                          {
                              "quantity": "1",
                              "name": "item",
                              "price": "7.41",
                              "currency": "USD",
                              "sku": "item"
                          }]
                  }
              }
          ]
      }
      print headers
      print data
      r = requests.post(payment_url, headers=headers, data=data)
      print 'payment res', r.text
  </code></pre>
  
  <p>And I only get the response like this:</p>
  
  <pre><code>{"name":"MALFORMED_REQUEST","message":"The request JSON is not well formed.","information_link":"https://developer.paypal.com/webapps/developer/docs/api/#MALFORMED_REQUEST","debug_id":"262cbdc417df7"}
  </code></pre>
  
  <p>I have seen quite a few questions regarding this kind of error, but none of them have solution yet. :(
  The json formated post data is obviously valid. Otherwise, requests post method would raise exceptions. And the response is returned from paypal server, but I can't find any information from the link it gave. I have checked Rest API documentation, and I think I made the request exactly as the samples. What did I miss? </p>
  
  <p>Any kind advice or solution would be appreciated.</p>