title: How to pass bytes data in payload during invoking AWS Lambda function
body: <p>I have on Lambda function which input is </p>
  
  <pre><code>input_str = "&lt;html&gt;&lt;body&gt;&lt;h1&gt;Title&lt;/h1&gt;&lt;Hello World&gt;&lt;/body&gt;&lt;/html&gt;"
  input_base64 = base64.b64encode(bytes(input_str, 'utf-8'))
  payload = {"html_base64" : input_base64} 
  </code></pre>
  
  <p>here <code>input_base64</code> is bytes type variable</p>
  
  <p>I am invoking this Lambda function from other Lambda function, but I am not able pass this payload</p>
  
  <pre><code>invoke_response = lambda_client.invoke(FunctionName="vivek_05",
                                         InvocationType='RequestResponse',
                                         Payload=payload
                                         )
  </code></pre>
  
  <p>Getting following exception:</p>
  
  <pre><code>  "errorMessage": "Parameter validation failed:\nInvalid type for parameter Payload, value: {'html_base64': b'PGh0bWw+PGJvZHk+PGgxPlRpdGxlPC9oMT48SGVsbG8gV29ybGQ+PC9ib2R5PjwvaHRtbD4='}, type: &lt;class 'dict'&gt;, valid types: &lt;class 'bytes'&gt;, &lt;class 'bytearray'&gt;, file-like object",
  </code></pre>
  
  <p>Can you help me?</p>