We’re calling it from a Dropwizard java service, which used Jersey’s client under the hood, but when we posted an event into Cube, we got a slightly weird error, a 400 (bad request) with the following message:
add the following to the httpClient section of your Dropwizard config,
What seems to happen is that Jersey’s client gzip encodes all requests by default, (and duly sets the Content-Encoding header to gzip).
We used Charles Proxy to look at the request – and noticed that the first character of the compressed request is “1f” in hex, which happens to be the hex representation of the offending unicode character “\u001f” (which is an obscure non-printing control character, and a big fat red herring.)
So either Cube, or node or something is unable to accept gzip encoded requests, and barfs out a bad request.