route match on header?

15 views
Skip to first unread message

Roger Parkinson

unread,
Dec 18, 2022, 8:52:20 PM12/18/22
to wiremock-user
In my mappings file I have these two entries:

    {
      "request": {
        "method": "POST",
        "url": "/middleware-nz-sandbox/v2.0/domestic-payment-consents",
        "headers": {
            "x-fapi-interaction-id": {
                "caseInsensitive": true,
                "equalTo": "okay"
            }
        }
      },
      "response": {
        "status": 201,
        "bodyFileName": "payment-consents.json"
      }
    },
    {
      "request": {
        "method": "POST",
        "url": "/middleware-nz-sandbox/v2.0/domestic-payment-consents",
        "headers": {
             "x-fapi-interaction-id": {
                "caseInsensitive": true,
                "equalTo": "error"
            }
        }
      },
      "response": {
        "status": 500,
        "bodyFileName": "payment-consents-error.json"
      }
    },

But when I send a request with header x-fapi-interaction-id set to error it matches the first request every time. It seems like I must have missed something but I'm not sure what. All the other requests are working fine, but none of them attempt to match on the header.
Thanks for any help
R
Reply all
Reply to author
Forward
0 new messages