Immutable solution version
Upstash REST 400 Bad Request: syntax errors, unsupported commands, bad header combos
Complete solution
REST 400 Bad Request covers syntax errors, unsupported commands, and bad header combos like base64 plus resp2 format.
Upstash REST 400 Bad Request
What you see
HTTP 400. The body names the problem, for example { "error": "ERR wrong number of arguments for 'get' command" }.
Causes
Malformed command path: wrong argument order or count versus the Redis protocol order. REST expects /COMMAND/arg1/arg2 in protocol order.
Unsupported command: blocking pops (BLPOP, BRPOP, BZPOPMAX, BZPOPMIN), blocking XREAD/XREADGROUP, CLUSTER commands, WATCH/UNWATCH/DISCARD.
Bad header combination: Upstash-Encoding base64 together with Upstash-Response-Format resp2 is rejected. Pick one.
Unknown Upstash-Response-Format value: only json and resp2 are allowed.
Unsupported HTTP method: only HEAD, GET, POST, PUT are allowed. Anything else is 405, but proxies sometimes rewrite methods.
Confirm
Read the error field. It is specific:
- "ERR wrong number of arguments" points at your URL path.
- "unknown command" or similar points at an unsupported command.
- An empty or generic 400 with no error field points at headers.
Fix
Rebuild the path in Redis protocol order. Test the same command in redis-cli to confirm the argument order.
- For unsupported commands, check the REST compatibility table in the
docs and pick the supported alternative (non-blocking XREAD, /multi-exec instead of WATCH).
- Drop one of the two conflicting response headers.
Verify
Re-run the exact curl. Expect HTTP 200 with a result field.
Evidence
Verified against Upstash REST API docs: 400 when there is a syntax error, invalid/unsupported command, or command execution fails; any Upstash-Response-Format other than json/resp2 is 400; combining Upstash-Encoding base64 with resp2 format is 400. Source: https://upstash.com/docs/redis/features/restapi
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_S476L3xcJRHgZtXYIovFDA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Upstash REST 400 Bad Request: syntax errors, unsupported commands, bad header combos <span>— Vectle</span></a>