The user encountered an issue where the HTTP Request feature of the HTTP module creates a target variable with no content when receiving a 204 No Content response. This disrupts downstream processes, as attempts to parse the variable as JSON result in an error.
Symptoms
- An outbound HTTP Requester receives `HTTP/1.1 204 No Content` from a third-party API.
- The requester itself raises no error (204 is a 2xx success code).
- The configured `target` variable is created, so null-checks such as `vars.myVar != null` return `true`.
- Any subsequent DataWeave expression that reads the variable — including `isEmpty(vars.myVar)` — throws:
Error Message
org.mule.weave.v2.module.reader.ReaderParsingException:
Unable to parse empty input, while reading `<variable>` as Json.
Environment
- Mule Runtime: 4.4.x / 4.5.x / 4.6.x / 4.9.x (all observed)
- Connector: HTTP Connector 1.7.x – 1.10.x
- Deployment: CloudHub 1.0 / CloudHub 2.0 / RTF / On-Prem — behaviour identical across targets
Cause
Two things combine:
1. The remote server returns a malformed 204.** Per RFC 7230 §3.3.2 and RFC 7231 §6.3.5, a `204 No Content` response MUST NOT include a message body and should not advertise a `Content-Type`. Several third-party APIs (including some AWS API Gateway–fronted services) return 204 with headers such as:
HTTP/1.1 204 No Content
Content-Type: application/json
Content-Length: 0
The "Content-Type: application/json" on a zero-byte body is the root defect — there is no JSON document.
2. The Mule HTTP Requester faithfully reflects the wire response. The `target` variable is populated with an empty `CursorStreamProvider` (or empty byte array, depending on streaming strategy) whose DataWeave MIME type is inherited from the server's `Content-Type` header. The stream exists, so it is not `null`. When any downstream expression touches the variable — a Transform, a `logger`, a `choice` predicate, even `isEmpty()` — DataWeave coerces the empty payload from `application/json`, and a zero-byte input is not a legal JSON document (not even `null`, which is 4 bytes). The parser raises `Unable to parse empty input`.
This is working-as-designed on the Mule side: auto-converting any empty 2xx body to `null` would be a breaking change for flows that rely on a typed empty payload (HEAD requests, 200s with `Content-Length: 0` used as success sentinels, binary passthrough, proxy-style flows).
005321690

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.