title: Curl code to R with postFrom or POST
body: <p>I've attempted to covert some curl code using both the postForm &amp; POST methods in R following some other examples on here, however, i'm encountering 400 errors.</p>
  
  <p>Here's the Curl i want to translate: </p>
  
  <pre><code>curl -X POST --header 'Content-Type: application/json;charset=UTF-8' --
  header 'Accept: application/json' -d '[
    {
  
  "campaignKwType":"DESTINATION_LANDMARK",
  "featureId": 9849,
  "guid": "xyz",
  "language": "ENG",
  "lob": "HOTEL",
  "matchType": "EXACT",
  "posa": "GBR",
  "remarketingType": "NEW_CUSTOMERS",
  "searchEngine": "GOOGLE",
  "superRegionCampRef": true
   } ]' 'https://apiaddress'
  </code></pre>
  
  <p>With postForm:</p>
  
  <pre><code>   x &lt;- postForm("https://apiaddress",
           .opts = list(postfields = toJSON(list(campaignKwType = "DESTINATION_LANDMARK", featureId = 9849,  guid = "xyz", language = "ENG", lob = "HOTEL", matchType = "EXACT", posa = "GBR", remarketingType = "NEW_CUSTOMERS", searchEngine = "GOOGLE", superRegionCampRef = TRUE)),
                        httpheader = c('Content-Type' = 'application/json;charset=UTF-8', Accept = 'application/json')))
  </code></pre>
  
  <p>With POST:</p>
  
  <pre><code>x &lt;- POST("https://apiaddress",
                 verbose(),
                 encode = "json",
                 body = list(c(campaignKwType = "DESTINATION_LANDMARK", featureId = 9849,  guid = "xyz", language = "ENG", lob = "HOTEL", matchType = "EXACT", posa = "GBR", remarketingType = "NEW_CUSTOMERS", searchEngine = "GOOGLE", superRegionCampRef = TRUE))
                 )
  </code></pre>
  
  <p>Would appreciate any pointers, i've used other questions as an example for both of these requests and i've also checked the curl itself works. Thanks!</p>