title: Uploading files using multipart/form-data through REST API
body: <p>I'm trying to upload 4 files to be used as a request body in a REST API call through Robot Framework. I'm using the <a href="https://github.com/bulkan/robotframework-requests" rel="nofollow">Requests</a> library to achieve this.</p>
  
  <p>I think I'm facing a problem with setting the correct MIME type/boundary as this is the error that is thrown if I run the file using pybot:</p>
  
  <pre><code>{u'errorMessage': u"Couldn't find MIME boundary: ------Bound0901"}
  </code></pre>
  
  <ol>
  <li>Is this the correct way to set the MIME boundary?</li>
  <li>Can I set custom MIME boundaries, like I have in the code sample given below? Or am I required to set boundaries that are defined by the web app?</li>
  </ol>
  
  <p>Here's the code that I'm using to get this done:</p>
  
  <pre><code>Library  |  RequestsLibrary
  
  *** TestCases ***
  
  1. Login
      Create Session  |  host  |  http://10.10.20.20
      &amp;{headers}=  |  Create Dictionary  |  user=scott  |  password=tiger
      ${response}=  |  RequestsLibrary.Get Request  |  host  |  /api/login  |  ${headers}
      &amp;{headers}    Create Dictionary  |  contentType=multipart/form-data;boundary=----Bound0901
      ${file1}=  |  Get Binary File  |  File1.au
      ${file2}=  |  Get Binary File  |  File2.crs
      ${file3}=  |  Get Binary File  |  File3.cst
      ${file4}=  |  Get Binary File  |  File4.des
  
      ${data}  |  Create Dictionary  |  ----Bound0901Detail={"Name":"APIContent1","isAICC": true,"version": "1.1","availableOffline": false}----Bound0901${file1}----Bound0901${file2}----Bound0901${file3}----Bound0901${file4}----Bound0901
  
      ${response}=  |  RequestsLibrary.Post Request  |  host  |  /api/contentimport  |  data=${data}  |  headers=${headers}
  
      Log    ${response.status_code}
      Log    ${response.json()}
  </code></pre>