Skip to content

Response selector malformed

The answer a project’s address gives when a request asks for one of a mock’s responses with a header that is not a valid request for one.

Field Value
type https://mockhub.dev/problems/response-selector-malformed
Status 400

A request can ask a mock for one of its response variants by sending X-MockHub-Response: <mock reference>:<response key>, with the last 12 characters of the mock’s identifier and the response’s key, such as 123456789abc:invalid-email. MockHub refuses the request before it looks for a mock when the header:

  • is empty, or has no :;
  • appears more than once on the request;
  • does not start with 12 characters of 0-9 and a-f, such as a whole mock identifier, or holds a key that is not 1 to 64 characters of a-z, 0-9, _ and -, starting with a letter or digit.

Nothing is answered, forwarded to the project’s upstream or counted as a request of any mock.

Always 400.

Only from a project’s own address, in every gateway mode. The request is recorded as a request no mock answered, so it counts in no hit, no webhook and no insights figure.

When detail
Always The X-MockHub-Response header must hold one value of the form <mock reference>:<response key>, as the mock's editor copies it.

This type carries no extension members.

{
"type": "https://mockhub.dev/problems/response-selector-malformed",
"title": "Malformed response selector",
"status": 400,
"detail": "The X-MockHub-Response header must hold one value of the form <mock reference>:<response key>, as the mock's editor copies it."
}
  • Copy the header from the mock’s editor instead of writing it: open the mock, open the response and select Copy header under Use this response in a request.
  • Send the header once. A client or a proxy that adds a second copy produces this error.
  • A key is written in lowercase; the key shown beside Response name is the one to use.

Report a problem with this page