title: python http.client : How to make a POST call with multipart/form-data content-type in the body
body: <p>I am trying to make a call to an end point which take a the content of being a json.</p>
  <p>I tried this</p>
  <pre><code>    def upload():
  
          connection = http.client.HTTPSConnection(self.url)
          headers = { 'Content-Type': 'multipart/form-data'}
          connection.request(&quot;POST&quot;, &quot;/&quot;,body=json.dumps(self.myjson), headers)
  </code></pre>
  <p>The content of my json is something like this</p>
  <pre><code>{&quot;file&quot;: { &quot;version&quot;:&quot;2.0&quot;, &quot;path&quot;:&quot;my path&quot;, &quot;test&quot;: &quot;content&quot;}}
  </code></pre>
  <p>The problem is that when I use postman and upload the file directly it works. But when I tried that portion of the code I have this error:</p>
  <pre><code>nested exception is java.lang.IllegalStateException: Cannot convert value of type [java.lang.String] to required type [org.springframework.web.multipart.MultipartFile] for property 'file[0]': no matching editors or conversion strategy found
  </code></pre>
  <p>How can I tackle this problem?</p>