Random errors POSTing to API

For feature requests, please see: http://www.mattermost.org/feature-requests/.

For troubleshooting questions, please post in the following format:


I’ve written a bot to take CloudWatch data and create MM messages from it. I’ve been getting random 400 responses on some of the messages I’m sending. For instance, this message:
":git-pr: LTP: kmturley opened [CLOUD-7953 LTP - update README.md](link) | [SourceGraph](link) | [CLOUD-7953 ](link) | Reviewers: @fawzy"

works just fine, but this one:

":git-pr: LTP: kmturley opened [CLOUD-7954 LTP - update README.md](link) | [SourceGraph](link) | [CLOUD-7954 ](link) | Reviewers: @fawzy"

which was made about 20 minutes later, failed with this error:

“id”: “api.context.invalid_body_param.app_error”,
“message”: “Invalid or missing post in request body”,
“detailed_error”: “”,
“request_id”: “bfh16mhzapdimqe7rbkzyto9ir”,
“status_code”: 400

Both messages were sent by the same bot with the same parameters, so I refuse to believe that something that was present in the first request was missing from the second. The only difference in the two are alphanumeric characters, mainly in the SourceGraph and JIRA links.

Any help here would be appreciated.

Steps to reproduce

Write a bot using the API, and post the above two messages.

Expected behavior

I expect both messages to go thru, since they differ by less than 10 characters.

Observed behavior

One went thru, one did not.