title: AWS API Gateway mapping json and pdf
body: <p>I have my API Gateway set up with <code>application/json</code> Content-Type mapped to </p>
  
  <pre><code>{
      "param1": "$input.params('param1')"
  }
  </code></pre>
  
  <p>and <code>application/pdf</code> mapped to</p>
  
  <pre><code>{
      "content": "$input.body"
  }
  </code></pre>
  
  <p>Both of these work on their own when I use postman and specify the Content-Type as one or the other. 
  But, <strong>I want to be able to make a request that can take both pdf binary data along with some parameters from JSON using one call and use both in lambda</strong>. </p>
  
  <p>I've tried adding both of these in a content-type and setting the template as </p>
  
  <pre><code>{
      "content": "$input.body",
      "param1": "$input.params('param1')"
  }
  </code></pre>
  
  <p>But this returns back an error when I call it with the params and the pdf:
  <code>"message": "Could not parse request body into json: Illegal unquoted character ((CTRL-CHAR, code 10)): has to be escaped using backslash to be included in string value\n</code> </p>
  
  <p><em>The "param1" is a query string parameter I have added.</em> </p>