Integrations

Request-body length is not a character count: where should a developer check Content-Length?

If a request works with short text but fails after Arabic content is added, do not immediately remove Arabic or rename fields. One question for the developer is whether an intermediary manually derives body length from…

2 min readLast updated November 4, 2026
A developer and colleague reviewing a connection between business systems

If a request works with short text but fails after Arabic content is added, do not immediately remove Arabic or rename fields. One question for the developer is whether an intermediary manually derives body length from character count instead of transmitted bytes. This needs evidence; it is not an explanation for every transfer failure.

Understand the unit before changing the value

Content-Length measures the HTTP message body's size in bytes, not the words or characters a user sees. In an encoding such as UTF-8, a character can occupy more than one byte, so equating characters with size is not a general rule.

The value must also match the body actually sent after representation is prepared. Counting text before JSON serialisation or a change in escaping may not describe the final bytes. Arabic representation inside JSON explains visible text versus encoded representation.

Let the HTTP library manage transport details

Many integration paths let their library construct appropriate transport headers. Do not force a manual value into every request because an older example included one, or treat absence alone as a fault. Transfer mechanisms and cases differ.

The reviewed Taloo flow-step header settings reserve Content-Length. Do not try different capitalisation or another name to bypass rejection. Where an external system constructs a request incorrectly, review its contract and implementation there instead of changing the flow guard to reproduce the error.

Imagine an intermediary reading text, appending details and retaining a length calculated beforehand. The responsible person needs to compare the final body with its description and identify the modifying layer. Do not assume the receiver automatically repairs an inconsistent description.

Test the hypothesis with synthetic data

Prepare samples representing the required languages and content, recording source output and receiver input within an authorised test. Do not publish real request bodies or credentials to demonstrate the difference, or disable transport checks merely to pass.

If the issue continues with a matching size, investigate other causes rather than increasing or decreasing the number experimentally. Format, service limits or another connection layer may be responsible, each requiring its own evidence.

Read reserved headers and the receiving contract where the report concerns configuration. Final acceptance needs a correctly understood body, values and business outcome, rather than only a disappearing error after an unexplained number changes.