# Webhook delivery errors when length is incorrect

**URL:** <https://meta.discourse.org/t/webhook-delivery-errors-when-length-is-incorrect/49912>\
**Category:** Product Support\
**Created:** [08.Сентябрь.2016 22:09:01 UTC](https://meta.discourse.org/t/webhook-delivery-errors-when-length-is-incorrect/49912 "2016-09-08T22:09:01Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![rhyolight](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rhyolight/32/120422_2.png) [@rhyolight](https://meta.discourse.org/u/rhyolight)\
**Post date:** [09.Сентябрь.2016 15:56:57 UTC](https://meta.discourse.org/t/webhook-delivery-errors-when-length-is-incorrect/49912/3 "2016-09-09T15:56:57Z")

</div>

So I just replicated this error locally with curl based upon the last failing webhook I saw. I extracted the JSON POST body, minified it, and sent it along with the headers Discourse used when sending the data. I saw that upon minifying the JSON POST body, it was not the same size in bytes as the `Content-Length` header used by Discourse, so my curl command failed. When I changed the `Content-Length` to match the number of bytes actually in the POST body, it worked.

So the problem is that the `Content-Length` _sometimes_ does not match the number of bytes in the POST body, causing JSON parsing to fail because the entirely of the JSON CLOB was not loaded.

---

_[View the full topic](https://meta.discourse.org/t/webhook-delivery-errors-when-length-is-incorrect/49912)._
