title: requests.exceptions.HTTPError: 400 Client Error: Bad Request for url
body: <p>I am trying to create an object in a database using Python requests. I am able to do this with other URLs, but for this particular one I am getting errors. I am not sure if there is a problem with the actual request or the URL. Four items are required for creation, so I will just focus on those for now. </p>
  
  <p>Below you will find an example of the request payload according to the documentation:</p>
  
  <pre class="lang-py prettyprint-override"><code>def create_opportunity(self, data):
      try:
          r = requests.post(
              self.URL + 'sales/opportunities', data=data,
              headers=self.Header)
          r.raise_for_status()
      except:
          raise
      return r.json()
  
  create_opp = '{"name": "My Opportunity", "primarySalesRep": {"name": "John Doe"}, "company": {"name": "My Company"}, "contact": {"name": "Jane Doe"}}'
  
  opportunity = objCW.create_opportunity(create_opp)
  </code></pre>
  
  <p>payload example</p>
  
  <pre><code>{
    "name": "string",
    "primarySalesRep": {},
    "company": {},
    "contact": {}
  }
  </code></pre>
  
  <p>primarsySalesRep</p>
  
  <pre><code>"primarySalesRep": {
      "id": 0,
      "identifier": "string",
      "name": "string",
      "_info": { }
  },
  </code></pre>
  
  <p>company</p>
  
  <pre><code>"company": {
      "id": 0,
      "identifier": "string",
      "name": "string",
      "_info": { }
  },
  </code></pre>
  
  <p>contact</p>
  
  <pre><code>"contact": {
      "id": 0,
      "name": "string",
      "_info": { }
  },
  </code></pre>