title: "unexpected end of JSON input" when an array of objects is passed in POST request
body: <pre><code>import &quot;github.com/gin-gonic/gin&quot;
  
  func Receive(c *gin.Context) {
    // Gets JSON ecnoded data
    rawData, err := c.GetRawData()
    if err != nil {
        return nil, err
    }
  
    logger.Info(&quot;Raw data received - &quot;, rawData)
  }
  </code></pre>
  <p>This code snippet works when I pass a Json object <code>{&quot;key&quot;:&quot;value&quot;}</code> but gives an error:</p>
  <blockquote>
  <p>&quot;unexpected end of JSON input&quot;</p>
  </blockquote>
  <p>when I pass an array like <code>[{&quot;key&quot;:&quot;val&quot;},{&quot;key&quot;: &quot;val&quot;}]</code> as the input.</p>