title: How to send an HTML file content in REST API POST Request?
body: <p>I am trying to send an HTML file in a POST request in a python script.</p>
  
  <pre><code>html_source = """
          &lt;html&gt;
          &lt;head&gt;
          &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css"&gt;
          &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"&gt;&lt;/script&gt;
          &lt;script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"&gt;&lt;/script&gt;
          &lt;/head&gt;
          &lt;body&gt;
          &lt;table class="sstable table-bordered inner-table"&gt;
          &lt;tr&gt;
          &lt;th&gt;ID&lt;/th&gt;
          &lt;th&gt;Title&lt;/th&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
          &lt;td&gt;T01&lt;/td&gt;
          &lt;td&gt;Title 1&lt;/td&gt;
          &lt;/tr&gt;
            &lt;tr&gt;
          &lt;td&gt;T02&lt;/td&gt;
          &lt;td&gt;Title 2&lt;/td&gt;
          &lt;/tr&gt;
            &lt;tr&gt;
          &lt;td&gt;T03&lt;/td&gt;
          &lt;td&gt;Title 3&lt;/td&gt;
          &lt;/tr&gt;
          &lt;/table&gt;
          &lt;/body
          &lt;/html&gt;
          """
  auth_values = ('usernae','password')    
  data = '{"name":"Some Widget","dashboardId":7,"type":"text","content":' '"' +html_source+ '"''}'
  url = "company.com/api"
  response = requests.post(url, data=data, auth=auth_values)
  
  print ('Response Status:',response.status_code)
  print ('Response Body:',response.content)
  </code></pre>
  
  <p>However, the request gives the following response:</p>
  
  <pre><code>('Response Status:', 200)
  ('Response Body:', '{"data":null,"errmsg":"Invalid json body","status":1007}')
  </code></pre>
  
  <p>Is it because of the way I am trying to pass the HTML string? I tried escaping the HTML but it still didn't work.</p>
  
  <p>Is there a way I can point the <code>"content":</code> to a HTML file in my system?</p>