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 |
What it means
Section titled “What it means”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-9anda-f, such as a whole mock identifier, or holds a key that is not 1 to 64 characters ofa-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.
Status
Section titled “Status”Always 400.
Where it comes from
Section titled “Where it comes from”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."}What to do
Section titled “What to do”- 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.