Help with implementing tracking http session in WireMock.NET #381

Closed
opened 2025-12-29 15:22:20 +01:00 by adam · 6 comments
Owner

Originally created by @AndresGMD on GitHub (Oct 27, 2021).

Hi Stef,

is there anyway to implement following task, using static mappings.

Narrative: Session tracking requires that a session ID is maintained across multiple request to the server. This means that each time a given client makes a request to the server it passes the same session ID. The server can use this ID to lookup the session information it maintains. How works

In my reviews I know the following

How Implemented Lifetime session #652
How to associate Scenarios and States

Kind regards!

Originally created by @AndresGMD on GitHub (Oct 27, 2021). Hi Stef, is there anyway to implement following task, using static mappings. **Narrative:** Session tracking requires that a session ID is maintained across multiple request to the server. This means that each time a given client makes a request to the server it passes the same session ID. The server can use this ID to lookup the session information it maintains. [How works ](https://help.sap.com/doc/saphelp_nw73ehp1/7.31.19/en-US/4a/7620409dd972e2e10000000a42189b/content.htm?no_cache=true) In my reviews I know the following How Implemented Lifetime session [#652](https://github.com/WireMock-Net/WireMock.Net/issues/652) How to associate [Scenarios and States](https://github.com/WireMock-Net/WireMock.Net/wiki/Scenarios-and-Statesl) Kind regards!
adam added the question label 2025-12-29 15:22:20 +01:00
adam closed this issue 2025-12-29 15:22:20 +01:00
Author
Owner

@StefH commented on GitHub (Oct 28, 2021):

Hello @andresendava ,

You scenario is as follows (I think...)

  1. Client sends a HTTP request to WireMock.Net using a session-id = "12345"
  2. WireMock.Net responds with a 200 OK + a session-id headers which is also "12345"
  3. Client sends another HTTP request to WireMock.Net using a session-id = "12345"
  4. Because session-id = "12345" is already used, WireMock.Net responds with a 200 OK with the correct response
  5. Client sends another HTTP request to WireMock.Net using a session-id = "000"
  6. WireMock.Net does not know session-id "000", so it responds with a 404

This is what I think you request.
Is this correct ?

@StefH commented on GitHub (Oct 28, 2021): Hello @andresendava , You scenario is as follows (I think...) 1. Client sends a HTTP request to WireMock.Net using a session-id = "12345" 2. WireMock.Net responds with a 200 OK + a session-id headers which is also "12345" 3. Client sends another HTTP request to WireMock.Net using a session-id = "12345" 4. Because session-id = "12345" is already used, WireMock.Net responds with a 200 OK with the correct response 5. Client sends another HTTP request to WireMock.Net using a session-id = "000" 6. WireMock.Net does not know session-id "000", so it responds with a 404 This is what I think you request. Is this correct ?
Author
Owner

@AndresGMD commented on GitHub (Oct 28, 2021):

Good Morning @StefH !

That's correct!

Additional:

  1. The servlet retrieves the session-related information that is stored on the server-side. There are 2 alternatives:
    a. Cookies by Default
    b. Url rewriting in case that the client browser doesn't support cookies.

  2. After the session is completed (or timed out due to inactivity) the session object is removed from the server.

  3. I don't know if there is a way to view cookies. For example generating logs.

King regards!

@AndresGMD commented on GitHub (Oct 28, 2021): Good Morning @StefH ! That's correct! Additional: 1. The servlet retrieves the session-related information that is stored on the server-side. There are 2 alternatives: a. Cookies by Default b. [Url rewriting ](https://www.studytonight.com/servlet/url-rewriting-for-session-management.php) in case that the client browser doesn't support cookies. 2. After the session is completed (or timed out due to inactivity) the session object is removed from the server. 3. I don't know if there is a way to view cookies. For example generating logs. King regards!
Author
Owner

@AndresGMD commented on GitHub (Nov 2, 2021):

Hi @StefH Stef

I would like to use __admin/requests/find to use Session tracking

I have created a cookie:

image

I would like to filter theses requests by session id to try the cookie associate with these requests. Ex:

_POST http://localhost:8080/_admin/requests/find

{
    "request": {
        "Cookies": {
            "session_id": "456"
        }
    }
}

To filter the next request

[
    {
        "Guid": "98d9be2e-cb4d-4e89-b57d-cf982efb3964",
        "Request": {
            "ClientIP": "::1",
            "DateTime": "2021-11-03T19:54:27.435662Z",
            "Path": "/states/1",
            "AbsolutePath": "/states/1",
            "Url": "http://localhost:8080/states/1",
            "AbsoluteUrl": "http://localhost:8080/states/1",
            "Query": {},
            "Method": "GET",
            "Headers": {
                "Connection": [
                    "keep-alive"
                ],
                "Content-Type": [
                    "application/json"
                ],
                "Accept": [
                    "*/*"
                ],
                "Accept-Encoding": [
                    "gzip, deflate, br"
                ],
                "Cookie": [
                    "session_id=456"
                ],
                "Host": [
                    "localhost:8080"
                ],
                "User-Agent": [
                    "PostmanRuntime/7.28.4"
                ],
                "Content-Length": [
                    "392"
                ],
                "x-api-key": [
                    "123"
                ],
                "Postman-Token": [
                    "ade424f3-0425-4127-be10-12915b31ea2c"
                ]
            },
            "Cookies": {
                "session_id": "456"
            }
        },
        "Response": {
            "StatusCode": 200,
            "Headers": {
                "Content-Type": [
                    "application/json; charset=UTF-8"
                ],
                "Content-Length": [
                    "105"
                ],
                "Date": [
                    "Tue, 26 Oct 2021 15:41:14 GMT"
                ]
            },
            "BodyAsJson": {
                "state": "Scenario 1",
                "Data": {
                    "person": [
                        {
                            "id": 1,
                            "name": "Eva Charpman",
                            "age": "33",
                            "Height": "1.63",
                            "gender": "female"
                        }
                    ]
                }
            },
            "DetectedBodyType": 2,
            "DetectedBodyTypeFromContentType": 0
        },
        "MappingGuid": "9570f35d-8404-4d9f-95cb-e5f5bc990147",
        "MappingTitle": "States & Scenarios",
        "RequestMatchResult": {
            "TotalScore": 3.0,
            "TotalNumber": 3,
            "IsPerfectMatch": true,
            "AverageTotalScore": 1.0,
            "MatchDetails": [
                {
                    "Name": "PathMatcher",
                    "Score": 1.0
                },
                {
                    "Name": "MethodMatcher",
                    "Score": 1.0
                },
                {
                    "Name": "ScenarioAndStateMatcher",
                    "Score": 1.0
                }
            ]
        },
        "PartialMappingGuid": "9570f35d-8404-4d9f-95cb-e5f5bc990147",
        "PartialMappingTitle": "States & Scenarios",
        "PartialRequestMatchResult": {
            "TotalScore": 3.0,
            "TotalNumber": 3,
            "IsPerfectMatch": true,
            "AverageTotalScore": 1.0,
            "MatchDetails": [
                {
                    "Name": "PathMatcher",
                    "Score": 1.0
                },
                {
                    "Name": "MethodMatcher",
                    "Score": 1.0
                },
                {
                    "Name": "ScenarioAndStateMatcher",
                    "Score": 1.0
                }
            ]
        }
    }
]

But the result was

image

I try the next filter

{
    "Cookies": {
        "session_id": "456"
    }
}

But the result was

image

I don't sure if the filter was implemented correctly.

Kind regards

@AndresGMD commented on GitHub (Nov 2, 2021): Hi @StefH Stef I would like to use __admin/requests/find to use Session tracking I have created a cookie: <img width="1006" alt="image" src="https://user-images.githubusercontent.com/90065355/140182262-81b42b57-1c76-4328-b8e3-48dca6dc9cd0.png"> I would like to filter theses requests by session id to try the cookie associate with these requests. Ex: _POST http://localhost:8080/__admin/requests/find_ ``` { "request": { "Cookies": { "session_id": "456" } } } ``` To filter the next request ``` [ { "Guid": "98d9be2e-cb4d-4e89-b57d-cf982efb3964", "Request": { "ClientIP": "::1", "DateTime": "2021-11-03T19:54:27.435662Z", "Path": "/states/1", "AbsolutePath": "/states/1", "Url": "http://localhost:8080/states/1", "AbsoluteUrl": "http://localhost:8080/states/1", "Query": {}, "Method": "GET", "Headers": { "Connection": [ "keep-alive" ], "Content-Type": [ "application/json" ], "Accept": [ "*/*" ], "Accept-Encoding": [ "gzip, deflate, br" ], "Cookie": [ "session_id=456" ], "Host": [ "localhost:8080" ], "User-Agent": [ "PostmanRuntime/7.28.4" ], "Content-Length": [ "392" ], "x-api-key": [ "123" ], "Postman-Token": [ "ade424f3-0425-4127-be10-12915b31ea2c" ] }, "Cookies": { "session_id": "456" } }, "Response": { "StatusCode": 200, "Headers": { "Content-Type": [ "application/json; charset=UTF-8" ], "Content-Length": [ "105" ], "Date": [ "Tue, 26 Oct 2021 15:41:14 GMT" ] }, "BodyAsJson": { "state": "Scenario 1", "Data": { "person": [ { "id": 1, "name": "Eva Charpman", "age": "33", "Height": "1.63", "gender": "female" } ] } }, "DetectedBodyType": 2, "DetectedBodyTypeFromContentType": 0 }, "MappingGuid": "9570f35d-8404-4d9f-95cb-e5f5bc990147", "MappingTitle": "States & Scenarios", "RequestMatchResult": { "TotalScore": 3.0, "TotalNumber": 3, "IsPerfectMatch": true, "AverageTotalScore": 1.0, "MatchDetails": [ { "Name": "PathMatcher", "Score": 1.0 }, { "Name": "MethodMatcher", "Score": 1.0 }, { "Name": "ScenarioAndStateMatcher", "Score": 1.0 } ] }, "PartialMappingGuid": "9570f35d-8404-4d9f-95cb-e5f5bc990147", "PartialMappingTitle": "States & Scenarios", "PartialRequestMatchResult": { "TotalScore": 3.0, "TotalNumber": 3, "IsPerfectMatch": true, "AverageTotalScore": 1.0, "MatchDetails": [ { "Name": "PathMatcher", "Score": 1.0 }, { "Name": "MethodMatcher", "Score": 1.0 }, { "Name": "ScenarioAndStateMatcher", "Score": 1.0 } ] } } ] ``` But the result was <img width="784" alt="image" src="https://user-images.githubusercontent.com/90065355/140184771-44f62faa-5176-47ed-bead-208301cbb0e4.png"> I try the next filter ``` { "Cookies": { "session_id": "456" } } ``` But the result was <img width="1017" alt="image" src="https://user-images.githubusercontent.com/90065355/140185510-694ea22d-e55d-470b-9f62-2d7601e878e5.png"> I don't sure if the filter was implemented correctly. Kind regards
Author
Owner

@StefH commented on GitHub (Nov 3, 2021):

https://github.com/WireMock-Net/WireMock.Net/issues/665

@StefH commented on GitHub (Nov 3, 2021): https://github.com/WireMock-Net/WireMock.Net/issues/665
Author
Owner

@AndresGMD commented on GitHub (Nov 4, 2021):

Hi @StefH

Because filtering by body does not work correctly for parameters other than path. I was thinking in another option could be to implement a capability that allows me to filter cookies using the URL Rewriting method:

In general can looks like the following:

__admin/requests/cookie/(Name)/(Value)
or
__admin/requests/find/cookie/(Name)/(Value)

i.e. Given:

image

__admin/requests/cookie/session_id/456
or
__admin/requests/find/cookie/session_id/456

Thanks in advace

@AndresGMD commented on GitHub (Nov 4, 2021): Hi @StefH Because filtering by body does not work correctly for parameters other than **path**. I was thinking in another option could be to implement a capability that allows me to filter cookies using the URL Rewriting method: In general can looks like the following: ___admin/requests/cookie/(Name)/(Value)_ or ___admin/requests/find/cookie/(Name)/(Value)_ i.e. Given: <img width="986" alt="image" src="https://user-images.githubusercontent.com/90065355/140325792-b6a86c17-1156-440a-bbe1-0cfc3e071923.png"> ___admin/requests/cookie/session_id/456_ or ___admin/requests/find/cookie/session_id/456_ Thanks in advace
Author
Owner

@AndresGMD commented on GitHub (Nov 4, 2021):

@StefH ,

I have found the solution by filtering with Body

I Found that Cookie is a collection. I make a prove sending a request with session_id=123 And 2 request with session_id = 456

I check the requests _http://localhost:8080/_admin/requests

[
    {
        "Guid": "ecca4c0e-116c-426a-a04c-5466451fed14",
        "Request": {
            "ClientIP": "::1",
            "DateTime": "2021-11-04T14:50:35.713853Z",
            "Path": "/states/1",
            "AbsolutePath": "/states/1",
            "Url": "http://localhost:8080/states/1",
            "AbsoluteUrl": "http://localhost:8080/states/1",
            "Query": {},
            "Method": "GET",
            "Headers": {
                "Connection": [
                    "keep-alive"
                ],
                "Content-Type": [
                    "application/json"
                ],
                "Accept": [
                    "*/*"
                ],
                "Accept-Encoding": [
                    "gzip, deflate, br"
                ],
                "Cookie": [
                    "session_id=123"
                ],
                "Host": [
                    "localhost:8080"
                ],
                "User-Agent": [
                    "PostmanRuntime/7.28.4"
                ],
                "Content-Length": [
                    "392"
                ],
                "x-api-key": [
                    "123"
                ],
                "Postman-Token": [
                    "489e4408-90a0-41a1-8e61-d9acc2f6b9a9"
                ]
            },
            "Cookies": {
                "session_id": "123"
            }
        },
        "Response": {
            "StatusCode": 200,
            "Headers": {
                "Content-Type": [
                    "application/json; charset=UTF-8"
                ],
                "Content-Length": [
                    "105"
                ],
                "Date": [
                    "Tue, 26 Oct 2021 15:41:14 GMT"
                ]
            },
            "BodyAsJson": {
                "state": "Scenario 2",
                "Data": {
                    "person": [
                        {
                            "id": 1,
                            "name": "Eva Charpman",
                            "age": "33",
                            "Height": "1.63",
                            "gender": "female"
                        }
                    ]
                }
            },
            "DetectedBodyType": 2,
            "DetectedBodyTypeFromContentType": 0
        },
        "MappingGuid": "ed18595b-6fe5-4c27-b04b-8ee2f8d4be10",
        "MappingTitle": "States & Scenarios",
        "RequestMatchResult": {
            "TotalScore": 3.0,
            "TotalNumber": 3,
            "IsPerfectMatch": true,
            "AverageTotalScore": 1.0,
            "MatchDetails": [
                {
                    "Name": "PathMatcher",
                    "Score": 1.0
                },
                {
                    "Name": "MethodMatcher",
                    "Score": 1.0
                },
                {
                    "Name": "ScenarioAndStateMatcher",
                    "Score": 1.0
                }
            ]
        },
        "PartialMappingGuid": "ed18595b-6fe5-4c27-b04b-8ee2f8d4be10",
        "PartialMappingTitle": "States & Scenarios",
        "PartialRequestMatchResult": {
            "TotalScore": 3.0,
            "TotalNumber": 3,
            "IsPerfectMatch": true,
            "AverageTotalScore": 1.0,
            "MatchDetails": [
                {
                    "Name": "PathMatcher",
                    "Score": 1.0
                },
                {
                    "Name": "MethodMatcher",
                    "Score": 1.0
                },
                {
                    "Name": "ScenarioAndStateMatcher",
                    "Score": 1.0
                }
            ]
        }
    },
    {
        "Guid": "53a4b3f2-18a0-4db5-a587-f4d744a01bd5",
        "Request": {
            "ClientIP": "::1",
            "DateTime": "2021-11-04T14:55:32.312843Z",
            "Path": "/states/1",
            "AbsolutePath": "/states/1",
            "Url": "http://localhost:8080/states/1",
            "AbsoluteUrl": "http://localhost:8080/states/1",
            "Query": {},
            "Method": "GET",
            "Headers": {
                "Connection": [
                    "keep-alive"
                ],
                "Content-Type": [
                    "application/json"
                ],
                "Accept": [
                    "*/*"
                ],
                "Accept-Encoding": [
                    "gzip, deflate, br"
                ],
                "Cookie": [
                    "session_id=456"
                ],
                "Host": [
                    "localhost:8080"
                ],
                "User-Agent": [
                    "PostmanRuntime/7.28.4"
                ],
                "Content-Length": [
                    "392"
                ],
                "x-api-key": [
                    "123"
                ],
                "Postman-Token": [
                    "be95a919-e7f5-4cc2-ab27-3de6f5d2f1c5"
                ]
            },
            "Cookies": {
                "session_id": "456"
            }
        },
        "Response": {
            "StatusCode": 200,
            "Headers": {
                "Content-Type": [
                    "application/json; charset=UTF-8"
                ],
                "Content-Length": [
                    "105"
                ],
                "Date": [
                    "Tue, 26 Oct 2021 15:41:14 GMT"
                ]
            },
            "BodyAsJson": {
                "state": "Scenario 3",
                "Data": {
                    "person": [
                        {
                            "id": 1,
                            "name": "Eva Charpman",
                            "age": "33",
                            "Height": "1.63",
                            "gender": "female"
                        }
                    ]
                }
            },
            "DetectedBodyType": 2,
            "DetectedBodyTypeFromContentType": 0
        },
        "MappingGuid": "10baedbb-2cb6-4dae-a96b-5a4d07780aac",
        "MappingTitle": "States & Scenarios",
        "RequestMatchResult": {
            "TotalScore": 3.0,
            "TotalNumber": 3,
            "IsPerfectMatch": true,
            "AverageTotalScore": 1.0,
            "MatchDetails": [
                {
                    "Name": "PathMatcher",
                    "Score": 1.0
                },
                {
                    "Name": "MethodMatcher",
                    "Score": 1.0
                },
                {
                    "Name": "ScenarioAndStateMatcher",
                    "Score": 1.0
                }
            ]
        },
        "PartialMappingGuid": "10baedbb-2cb6-4dae-a96b-5a4d07780aac",
        "PartialMappingTitle": "States & Scenarios",
        "PartialRequestMatchResult": {
            "TotalScore": 3.0,
            "TotalNumber": 3,
            "IsPerfectMatch": true,
            "AverageTotalScore": 1.0,
            "MatchDetails": [
                {
                    "Name": "PathMatcher",
                    "Score": 1.0
                },
                {
                    "Name": "MethodMatcher",
                    "Score": 1.0
                },
                {
                    "Name": "ScenarioAndStateMatcher",
                    "Score": 1.0
                }
            ]
        }
    },
    {
        "Guid": "6cc01bd6-470d-41ed-9be6-98629fba3617",
        "Request": {
            "ClientIP": "::1",
            "DateTime": "2021-11-04T15:09:49.983713Z",
            "Path": "/states/1",
            "AbsolutePath": "/states/1",
            "Url": "http://localhost:8080/states/1",
            "AbsoluteUrl": "http://localhost:8080/states/1",
            "Query": {},
            "Method": "GET",
            "Headers": {
                "Connection": [
                    "keep-alive"
                ],
                "Content-Type": [
                    "application/json"
                ],
                "Accept": [
                    "*/*"
                ],
                "Accept-Encoding": [
                    "gzip, deflate, br"
                ],
                "Cookie": [
                    "session_id=456"
                ],
                "Host": [
                    "localhost:8080"
                ],
                "User-Agent": [
                    "PostmanRuntime/7.28.4"
                ],
                "Content-Length": [
                    "392"
                ],
                "x-api-key": [
                    "123"
                ],
                "Postman-Token": [
                    "d14e9bcc-b82f-463e-b729-f946fdc199b0"
                ]
            },
            "Cookies": {
                "session_id": "456"
            }
        },
        "Response": {
            "StatusCode": 200,
            "Headers": {
                "Content-Type": [
                    "application/json; charset=UTF-8"
                ],
                "Content-Length": [
                    "105"
                ],
                "Date": [
                    "Tue, 26 Oct 2021 15:41:14 GMT"
                ]
            },
            "BodyAsJson": {
                "state": "Scenario 1",
                "Data": {
                    "person": [
                        {
                            "id": 1,
                            "name": "Eva Charpman",
                            "age": "33",
                            "Height": "1.63",
                            "gender": "female"
                        }
                    ]
                }
            },
            "DetectedBodyType": 2,
            "DetectedBodyTypeFromContentType": 0
        },
        "MappingGuid": "d7c25ef5-6e88-43ff-96fc-2116850ab14b",
        "MappingTitle": "States & Scenarios",
        "RequestMatchResult": {
            "TotalScore": 3.0,
            "TotalNumber": 3,
            "IsPerfectMatch": true,
            "AverageTotalScore": 1.0,
            "MatchDetails": [
                {
                    "Name": "PathMatcher",
                    "Score": 1.0
                },
                {
                    "Name": "MethodMatcher",
                    "Score": 1.0
                },
                {
                    "Name": "ScenarioAndStateMatcher",
                    "Score": 1.0
                }
            ]
        },
        "PartialMappingGuid": "d7c25ef5-6e88-43ff-96fc-2116850ab14b",
        "PartialMappingTitle": "States & Scenarios",
        "PartialRequestMatchResult": {
            "TotalScore": 3.0,
            "TotalNumber": 3,
            "IsPerfectMatch": true,
            "AverageTotalScore": 1.0,
            "MatchDetails": [
                {
                    "Name": "PathMatcher",
                    "Score": 1.0
                },
                {
                    "Name": "MethodMatcher",
                    "Score": 1.0
                },
                {
                    "Name": "ScenarioAndStateMatcher",
                    "Score": 1.0
                }
            ]
        }
    },
    {
        "Guid": "9e185bef-0830-40e1-8b16-f546ded3a7ed",
        "Request": {
            "ClientIP": "127.0.0.1",
            "DateTime": "2021-11-04T15:20:55.011301Z",
            "Path": "/api/passphrase",
            "AbsolutePath": "/api/passphrase",
            "Url": "https://gearssdk.opswat.com/api/passphrase",
            "AbsoluteUrl": "https://gearssdk.opswat.com/api/passphrase",
            "Query": {},
            "Method": "GET",
            "Headers": {
                "Accept": [
                    "*/*"
                ],
                "Host": [
                    "gearssdk.opswat.com"
                ],
                "OPSWAT-Request-Token": [
                    "189a5e181f0e54fe265c4553a388dbc3e098e73dca178dd5c85fb63d56bb97b16026a471606daca4600b760e950186876f47453a95941d4af2e1b45992dcc309b1646cac587853ca4693d2a257367610ae134a3772a3deada3a9ea57f8930d316cd33f1eb97bbf0609b5cda16274b5c1e603644a4576c8aef3f0aec5e228abab75ce4f468678865e7088dbf6cb27962a484ea6cbb4faa98e31eec7d209b25a292923b9651bbf521258baf0bd1eeda66162fcd2e5e3893cb0a270c09c7c271c466bfe3833f0781ba5d70731c539e55be813520dfb0fb580b1aa92567bd20bcce02f70bcab481fbbe61023f0f1a0bc1a37183120abd43449a294f138cc0ba653e2_a148d79e2f0487d4c592a5577340d522528ad61aa90f92782ea4ae96af6a16dc354dd34c1583639b26cbea62f652c2bd4a778b6a0dc4d89a039322c8fa7c36f6aab873a95299ddb0434aa39bb084ec50aa1a648590c1a5717cb961b7e4e8199e1a5624bc5571a4b1906875373491eb429891425660aa2144c681f5c9b79fc5e0c21f65dde72cde4b9a75af1d31a5e843b941ff7baff9eccbf73477e70f04a7973cc28ff3a507fbf7588f5d9295c4a4c0bf71e55a4a1c1d98a3675b45e62fda9c78d98f8b6152e99e06ec3674519c67463976dfd14c1c3214bfc7d6ea99cd42a42f522e01b61099827630338af824ffeacbd3b3ec8393c8574bdbeb2c488d967f_8e0d3c8802fff2ec07d0375d3d9c372873e6a0b26a43c7ba204214bb09a374ba5a82a28c4be557f68f5b558b0c42615965c034961ebf0ff452d69633ef5e5f5cd2681280599f78f168f4fe4e8b449a271ee436273bb446fa6fef903c05e2633a9cae14ffe3a52ca6e1c1b26e0d6586bc93f973617689945fe5285107bb9c4f049ef4eab30167decc289b14280605feddb1b132f20736c265c2e78278d7bebc1c03bf69c7962a1a2aef49d3e3e59e7174074ab69b597cf5b4cb9058becd39fa36167cc56bfbda5e54534859d472fd370b9d74950139f0fc5cd8c6e8d2e57246ec4ceca22ad0ad5e924c858bf213660d7f1e8e5914aa30284853e7991a7746da72"
                ]
            }
        },
        "Response": {
            "StatusCode": 404,
            "Headers": {
                "Content-Type": [
                    "application/json"
                ]
            },
            "BodyAsJson": {
                "Status": "No matching mapping found"
            },
            "DetectedBodyType": 2,
            "DetectedBodyTypeFromContentType": 0
        },
        "PartialMappingGuid": "4795d8ec-70b6-4906-9348-aca8de0b50b5",
        "PartialRequestMatchResult": {
            "TotalScore": 1.0,
            "TotalNumber": 2,
            "IsPerfectMatch": false,
            "AverageTotalScore": 0.5,
            "MatchDetails": [
                {
                    "Name": "PathMatcher",
                    "Score": 0.0
                },
                {
                    "Name": "MethodMatcher",
                    "Score": 1.0
                }
            ]
        }
    },
    {
        "Guid": "7324228e-6378-4c41-bde3-a74b4fcda7c5",
        "Request": {
            "ClientIP": "127.0.0.1",
            "DateTime": "2021-11-04T15:22:26.148385Z",
            "Path": "/api/passphrase",
            "AbsolutePath": "/api/passphrase",
            "Url": "https://gearssdk.opswat.com/api/passphrase",
            "AbsoluteUrl": "https://gearssdk.opswat.com/api/passphrase",
            "Query": {},
            "Method": "GET",
            "Headers": {
                "Accept": [
                    "*/*"
                ],
                "Host": [
                    "gearssdk.opswat.com"
                ],
                "OPSWAT-Request-Token": [
                    "aea84a5409404710f03c0fae28fda72ba3766dd4c9a95e6cb99d5bd71bc254c7ad30cb5bdb59f483fb5b7ae2ae70dcad8ffa8cd03b29400bab5a15be600f6d25222b5eec40c8530cb051b26e7a6bdb3e86802bc193a1a70b468810781c4da482a8dd16ecf9457237f90dd97794e7d2f080dc5a3ac5fb37971cdc27857a5f51192b6ecf2f4baeaa554eab3378c13dc0a6098b8023e9a8f03fb8b775565aad6abb96ec2ac4d36c368f3ffc4b98f8d8a6481f873fd24612054ff19ec45b7ad28680b9f39dfafd2b41e0ccb6a7b3e448a7c80fa787e02a862afafbb8092b9e2d8c670886d3c9a5dafe0ce78e131a8126793ba44cb052e4e1cae03154b7226bc83b0d_d72f039d21dd7312a1921bbdc04e98258c1854f2c243ba145375106e796d5a3c5cbd1bd54794b88b9928b9bc2dbd25f4a4259748c0f62e81eee943fd7e7818027f81ecd66947c1f31d175f672944842ea3939cc3d80b6c387b0db264d2cff662f22d71b4323fec2f9f87f2192b3f07f4aa666b82c789ade4bf9f340b17131f78ed9813940ed1b417f0a8333a402e407f9fc73f801946d7ea9f5841f7c7553be998bd7753a993e39d1bf55abb4e5c52b46d54c42b1d017cf561b1361e8bb5c42c7f7b80aa99798afe57212a30a959e86e7b66a4b2b94ece901806e935662ef175e44b2ac53398cf61faae61c66a4c3d9fece378ad7381838533e618ae9eb20838_36e1d58ef662b7baf8dd6105f0fcffeeba88c875b07798ece0ba50ae17e4b55fc9968131a775de0ee5b6fedc1c786bb2b0c61de467b0a3dd78940d6571a56b47cfbd469e84b64bca8d09f6b969872307bf057794dd3b256e08da873cb1f618c0723ce6eb3d9007e2eeecded5ea3b3238359d6cde2c87514f9feb4e911e6db04203efeeb032f2692bc2a3462ec4e8f114106594f95d2705c69c75a731f27e12b9cd3698d85c65f81874250e6d3c70b00d3fce2bb9241ee8895a666a6d849ff4f1ef55ed918587e2de4752141e2a813e10b8c2b3341443c66bc853bf022a0028ed6e3f00b8c689ff45e1662ce5249bd8db8b574775e22c418dab1b8f06ae33f8c1"
                ]
            }
        },
        "Response": {
            "StatusCode": 404,
            "Headers": {
                "Content-Type": [
                    "application/json"
                ]
            },
            "BodyAsJson": {
                "Status": "No matching mapping found"
            },
            "DetectedBodyType": 2,
            "DetectedBodyTypeFromContentType": 0
        },
        "PartialMappingGuid": "4795d8ec-70b6-4906-9348-aca8de0b50b5",
        "PartialRequestMatchResult": {
            "TotalScore": 1.0,
            "TotalNumber": 2,
            "IsPerfectMatch": false,
            "AverageTotalScore": 0.5,
            "MatchDetails": [
                {
                    "Name": "PathMatcher",
                    "Score": 0.0
                },
                {
                    "Name": "MethodMatcher",
                    "Score": 1.0
                }
            ]
        }
    }
]

###Filter
And I apply the filter inn the following way (I check in detail de CookieModel):

{
    "Cookies": [{
        "Matchers": [
            {             
                "Name" : "ExactMatcher",
                "Pattern":  "123"
            }
        ],
        "Name":"session_id"
    }]
}

And the result was:

[
{
"Guid": "ecca4c0e-116c-426a-a04c-5466451fed14",
"Request": {
"ClientIP": "::1",
"DateTime": "2021-11-04T14:50:35.713853Z",
"Path": "/states/1",
"AbsolutePath": "/states/1",
"Url": "http://localhost:8080/states/1",
"AbsoluteUrl": "http://localhost:8080/states/1",
"Query": {},
"Method": "GET",
"Headers": {
"Connection": [
"keep-alive"
],
"Content-Type": [
"application/json"
],
"Accept": [
"/"
],
"Accept-Encoding": [
"gzip, deflate, br"
],
"Cookie": [
"session_id=123"
],
"Host": [
"localhost:8080"
],
"User-Agent": [
"PostmanRuntime/7.28.4"
],
"Content-Length": [
"392"
],
"x-api-key": [
"123"
],
"Postman-Token": [
"489e4408-90a0-41a1-8e61-d9acc2f6b9a9"
]
},
"Cookies": {
"session_id": "123"
}
},
"Response": {
"StatusCode": 200,
"Headers": {
"Content-Type": [
"application/json; charset=UTF-8"
],
"Content-Length": [
"105"
],
"Date": [
"Tue, 26 Oct 2021 15:41:14 GMT"
]
},
"BodyAsJson": {
"state": "Scenario 2",
"Data": {
"person": [
{
"id": 1,
"name": "Eva Charpman",
"age": "33",
"Height": "1.63",
"gender": "female"
}
]
}
},
"DetectedBodyType": 2,
"DetectedBodyTypeFromContentType": 0
},
"MappingGuid": "ed18595b-6fe5-4c27-b04b-8ee2f8d4be10",
"MappingTitle": "States & Scenarios",
"RequestMatchResult": {
"TotalScore": 3.0,
"TotalNumber": 3,
"IsPerfectMatch": true,
"AverageTotalScore": 1.0,
"MatchDetails": [
{
"Name": "PathMatcher",
"Score": 1.0
},
{
"Name": "MethodMatcher",
"Score": 1.0
},
{
"Name": "ScenarioAndStateMatcher",
"Score": 1.0
}
]
},
"PartialMappingGuid": "ed18595b-6fe5-4c27-b04b-8ee2f8d4be10",
"PartialMappingTitle": "States & Scenarios",
"PartialRequestMatchResult": {
"TotalScore": 3.0,
"TotalNumber": 3,
"IsPerfectMatch": true,
"AverageTotalScore": 1.0,
"MatchDetails": [
{
"Name": "PathMatcher",
"Score": 1.0
},
{
"Name": "MethodMatcher",
"Score": 1.0
},
{
"Name": "ScenarioAndStateMatcher",
"Score": 1.0
}
]
}
}
]

I change de cookie filter

{
    "Cookies": [{
        "Matchers": [
            {             
                "Name" : "ExactMatcher",
                "Pattern":  "456"
            }
        ],
        "Name":"session_id"
    }]
}

And I get

[
    {
        "Guid": "53a4b3f2-18a0-4db5-a587-f4d744a01bd5",
        "Request": {
            "ClientIP": "::1",
            "DateTime": "2021-11-04T14:55:32.312843Z",
            "Path": "/states/1",
            "AbsolutePath": "/states/1",
            "Url": "http://localhost:8080/states/1",
            "AbsoluteUrl": "http://localhost:8080/states/1",
            "Query": {},
            "Method": "GET",
            "Headers": {
                "Connection": [
                    "keep-alive"
                ],
                "Content-Type": [
                    "application/json"
                ],
                "Accept": [
                    "*/*"
                ],
                "Accept-Encoding": [
                    "gzip, deflate, br"
                ],
                "Cookie": [
                    "session_id=456"
                ],
                "Host": [
                    "localhost:8080"
                ],
                "User-Agent": [
                    "PostmanRuntime/7.28.4"
                ],
                "Content-Length": [
                    "392"
                ],
                "x-api-key": [
                    "123"
                ],
                "Postman-Token": [
                    "be95a919-e7f5-4cc2-ab27-3de6f5d2f1c5"
                ]
            },
            "Cookies": {
                "session_id": "456"
            }
        },
        "Response": {
            "StatusCode": 200,
            "Headers": {
                "Content-Type": [
                    "application/json; charset=UTF-8"
                ],
                "Content-Length": [
                    "105"
                ],
                "Date": [
                    "Tue, 26 Oct 2021 15:41:14 GMT"
                ]
            },
            "BodyAsJson": {
                "state": "Scenario 3",
                "Data": {
                    "person": [
                        {
                            "id": 1,
                            "name": "Eva Charpman",
                            "age": "33",
                            "Height": "1.63",
                            "gender": "female"
                        }
                    ]
                }
            },
            "DetectedBodyType": 2,
            "DetectedBodyTypeFromContentType": 0
        },
        "MappingGuid": "10baedbb-2cb6-4dae-a96b-5a4d07780aac",
        "MappingTitle": "States & Scenarios",
        "RequestMatchResult": {
            "TotalScore": 3.0,
            "TotalNumber": 3,
            "IsPerfectMatch": true,
            "AverageTotalScore": 1.0,
            "MatchDetails": [
                {
                    "Name": "PathMatcher",
                    "Score": 1.0
                },
                {
                    "Name": "MethodMatcher",
                    "Score": 1.0
                },
                {
                    "Name": "ScenarioAndStateMatcher",
                    "Score": 1.0
                }
            ]
        },
        "PartialMappingGuid": "10baedbb-2cb6-4dae-a96b-5a4d07780aac",
        "PartialMappingTitle": "States & Scenarios",
        "PartialRequestMatchResult": {
            "TotalScore": 3.0,
            "TotalNumber": 3,
            "IsPerfectMatch": true,
            "AverageTotalScore": 1.0,
            "MatchDetails": [
                {
                    "Name": "PathMatcher",
                    "Score": 1.0
                },
                {
                    "Name": "MethodMatcher",
                    "Score": 1.0
                },
                {
                    "Name": "ScenarioAndStateMatcher",
                    "Score": 1.0
                }
            ]
        }
    },
    {
        "Guid": "6cc01bd6-470d-41ed-9be6-98629fba3617",
        "Request": {
            "ClientIP": "::1",
            "DateTime": "2021-11-04T15:09:49.983713Z",
            "Path": "/states/1",
            "AbsolutePath": "/states/1",
            "Url": "http://localhost:8080/states/1",
            "AbsoluteUrl": "http://localhost:8080/states/1",
            "Query": {},
            "Method": "GET",
            "Headers": {
                "Connection": [
                    "keep-alive"
                ],
                "Content-Type": [
                    "application/json"
                ],
                "Accept": [
                    "*/*"
                ],
                "Accept-Encoding": [
                    "gzip, deflate, br"
                ],
                "Cookie": [
                    "session_id=456"
                ],
                "Host": [
                    "localhost:8080"
                ],
                "User-Agent": [
                    "PostmanRuntime/7.28.4"
                ],
                "Content-Length": [
                    "392"
                ],
                "x-api-key": [
                    "123"
                ],
                "Postman-Token": [
                    "d14e9bcc-b82f-463e-b729-f946fdc199b0"
                ]
            },
            "Cookies": {
                "session_id": "456"
            }
        },
        "Response": {
            "StatusCode": 200,
            "Headers": {
                "Content-Type": [
                    "application/json; charset=UTF-8"
                ],
                "Content-Length": [
                    "105"
                ],
                "Date": [
                    "Tue, 26 Oct 2021 15:41:14 GMT"
                ]
            },
            "BodyAsJson": {
                "state": "Scenario 1",
                "Data": {
                    "person": [
                        {
                            "id": 1,
                            "name": "Eva Charpman",
                            "age": "33",
                            "Height": "1.63",
                            "gender": "female"
                        }
                    ]
                }
            },
            "DetectedBodyType": 2,
            "DetectedBodyTypeFromContentType": 0
        },
        "MappingGuid": "d7c25ef5-6e88-43ff-96fc-2116850ab14b",
        "MappingTitle": "States & Scenarios",
        "RequestMatchResult": {
            "TotalScore": 3.0,
            "TotalNumber": 3,
            "IsPerfectMatch": true,
            "AverageTotalScore": 1.0,
            "MatchDetails": [
                {
                    "Name": "PathMatcher",
                    "Score": 1.0
                },
                {
                    "Name": "MethodMatcher",
                    "Score": 1.0
                },
                {
                    "Name": "ScenarioAndStateMatcher",
                    "Score": 1.0
                }
            ]
        },
        "PartialMappingGuid": "d7c25ef5-6e88-43ff-96fc-2116850ab14b",
        "PartialMappingTitle": "States & Scenarios",
        "PartialRequestMatchResult": {
            "TotalScore": 3.0,
            "TotalNumber": 3,
            "IsPerfectMatch": true,
            "AverageTotalScore": 1.0,
            "MatchDetails": [
                {
                    "Name": "PathMatcher",
                    "Score": 1.0
                },
                {
                    "Name": "MethodMatcher",
                    "Score": 1.0
                },
                {
                    "Name": "ScenarioAndStateMatcher",
                    "Score": 1.0
                }
            ]
        }
    }
]

Thanks a lot!

@AndresGMD commented on GitHub (Nov 4, 2021): @StefH , I have found the solution by filtering with Body I Found that Cookie is a collection. I make a prove sending a request with session_id=123 And 2 request with session_id = 456 I check the requests _http://localhost:8080/__admin/requests_ ``` [ { "Guid": "ecca4c0e-116c-426a-a04c-5466451fed14", "Request": { "ClientIP": "::1", "DateTime": "2021-11-04T14:50:35.713853Z", "Path": "/states/1", "AbsolutePath": "/states/1", "Url": "http://localhost:8080/states/1", "AbsoluteUrl": "http://localhost:8080/states/1", "Query": {}, "Method": "GET", "Headers": { "Connection": [ "keep-alive" ], "Content-Type": [ "application/json" ], "Accept": [ "*/*" ], "Accept-Encoding": [ "gzip, deflate, br" ], "Cookie": [ "session_id=123" ], "Host": [ "localhost:8080" ], "User-Agent": [ "PostmanRuntime/7.28.4" ], "Content-Length": [ "392" ], "x-api-key": [ "123" ], "Postman-Token": [ "489e4408-90a0-41a1-8e61-d9acc2f6b9a9" ] }, "Cookies": { "session_id": "123" } }, "Response": { "StatusCode": 200, "Headers": { "Content-Type": [ "application/json; charset=UTF-8" ], "Content-Length": [ "105" ], "Date": [ "Tue, 26 Oct 2021 15:41:14 GMT" ] }, "BodyAsJson": { "state": "Scenario 2", "Data": { "person": [ { "id": 1, "name": "Eva Charpman", "age": "33", "Height": "1.63", "gender": "female" } ] } }, "DetectedBodyType": 2, "DetectedBodyTypeFromContentType": 0 }, "MappingGuid": "ed18595b-6fe5-4c27-b04b-8ee2f8d4be10", "MappingTitle": "States & Scenarios", "RequestMatchResult": { "TotalScore": 3.0, "TotalNumber": 3, "IsPerfectMatch": true, "AverageTotalScore": 1.0, "MatchDetails": [ { "Name": "PathMatcher", "Score": 1.0 }, { "Name": "MethodMatcher", "Score": 1.0 }, { "Name": "ScenarioAndStateMatcher", "Score": 1.0 } ] }, "PartialMappingGuid": "ed18595b-6fe5-4c27-b04b-8ee2f8d4be10", "PartialMappingTitle": "States & Scenarios", "PartialRequestMatchResult": { "TotalScore": 3.0, "TotalNumber": 3, "IsPerfectMatch": true, "AverageTotalScore": 1.0, "MatchDetails": [ { "Name": "PathMatcher", "Score": 1.0 }, { "Name": "MethodMatcher", "Score": 1.0 }, { "Name": "ScenarioAndStateMatcher", "Score": 1.0 } ] } }, { "Guid": "53a4b3f2-18a0-4db5-a587-f4d744a01bd5", "Request": { "ClientIP": "::1", "DateTime": "2021-11-04T14:55:32.312843Z", "Path": "/states/1", "AbsolutePath": "/states/1", "Url": "http://localhost:8080/states/1", "AbsoluteUrl": "http://localhost:8080/states/1", "Query": {}, "Method": "GET", "Headers": { "Connection": [ "keep-alive" ], "Content-Type": [ "application/json" ], "Accept": [ "*/*" ], "Accept-Encoding": [ "gzip, deflate, br" ], "Cookie": [ "session_id=456" ], "Host": [ "localhost:8080" ], "User-Agent": [ "PostmanRuntime/7.28.4" ], "Content-Length": [ "392" ], "x-api-key": [ "123" ], "Postman-Token": [ "be95a919-e7f5-4cc2-ab27-3de6f5d2f1c5" ] }, "Cookies": { "session_id": "456" } }, "Response": { "StatusCode": 200, "Headers": { "Content-Type": [ "application/json; charset=UTF-8" ], "Content-Length": [ "105" ], "Date": [ "Tue, 26 Oct 2021 15:41:14 GMT" ] }, "BodyAsJson": { "state": "Scenario 3", "Data": { "person": [ { "id": 1, "name": "Eva Charpman", "age": "33", "Height": "1.63", "gender": "female" } ] } }, "DetectedBodyType": 2, "DetectedBodyTypeFromContentType": 0 }, "MappingGuid": "10baedbb-2cb6-4dae-a96b-5a4d07780aac", "MappingTitle": "States & Scenarios", "RequestMatchResult": { "TotalScore": 3.0, "TotalNumber": 3, "IsPerfectMatch": true, "AverageTotalScore": 1.0, "MatchDetails": [ { "Name": "PathMatcher", "Score": 1.0 }, { "Name": "MethodMatcher", "Score": 1.0 }, { "Name": "ScenarioAndStateMatcher", "Score": 1.0 } ] }, "PartialMappingGuid": "10baedbb-2cb6-4dae-a96b-5a4d07780aac", "PartialMappingTitle": "States & Scenarios", "PartialRequestMatchResult": { "TotalScore": 3.0, "TotalNumber": 3, "IsPerfectMatch": true, "AverageTotalScore": 1.0, "MatchDetails": [ { "Name": "PathMatcher", "Score": 1.0 }, { "Name": "MethodMatcher", "Score": 1.0 }, { "Name": "ScenarioAndStateMatcher", "Score": 1.0 } ] } }, { "Guid": "6cc01bd6-470d-41ed-9be6-98629fba3617", "Request": { "ClientIP": "::1", "DateTime": "2021-11-04T15:09:49.983713Z", "Path": "/states/1", "AbsolutePath": "/states/1", "Url": "http://localhost:8080/states/1", "AbsoluteUrl": "http://localhost:8080/states/1", "Query": {}, "Method": "GET", "Headers": { "Connection": [ "keep-alive" ], "Content-Type": [ "application/json" ], "Accept": [ "*/*" ], "Accept-Encoding": [ "gzip, deflate, br" ], "Cookie": [ "session_id=456" ], "Host": [ "localhost:8080" ], "User-Agent": [ "PostmanRuntime/7.28.4" ], "Content-Length": [ "392" ], "x-api-key": [ "123" ], "Postman-Token": [ "d14e9bcc-b82f-463e-b729-f946fdc199b0" ] }, "Cookies": { "session_id": "456" } }, "Response": { "StatusCode": 200, "Headers": { "Content-Type": [ "application/json; charset=UTF-8" ], "Content-Length": [ "105" ], "Date": [ "Tue, 26 Oct 2021 15:41:14 GMT" ] }, "BodyAsJson": { "state": "Scenario 1", "Data": { "person": [ { "id": 1, "name": "Eva Charpman", "age": "33", "Height": "1.63", "gender": "female" } ] } }, "DetectedBodyType": 2, "DetectedBodyTypeFromContentType": 0 }, "MappingGuid": "d7c25ef5-6e88-43ff-96fc-2116850ab14b", "MappingTitle": "States & Scenarios", "RequestMatchResult": { "TotalScore": 3.0, "TotalNumber": 3, "IsPerfectMatch": true, "AverageTotalScore": 1.0, "MatchDetails": [ { "Name": "PathMatcher", "Score": 1.0 }, { "Name": "MethodMatcher", "Score": 1.0 }, { "Name": "ScenarioAndStateMatcher", "Score": 1.0 } ] }, "PartialMappingGuid": "d7c25ef5-6e88-43ff-96fc-2116850ab14b", "PartialMappingTitle": "States & Scenarios", "PartialRequestMatchResult": { "TotalScore": 3.0, "TotalNumber": 3, "IsPerfectMatch": true, "AverageTotalScore": 1.0, "MatchDetails": [ { "Name": "PathMatcher", "Score": 1.0 }, { "Name": "MethodMatcher", "Score": 1.0 }, { "Name": "ScenarioAndStateMatcher", "Score": 1.0 } ] } }, { "Guid": "9e185bef-0830-40e1-8b16-f546ded3a7ed", "Request": { "ClientIP": "127.0.0.1", "DateTime": "2021-11-04T15:20:55.011301Z", "Path": "/api/passphrase", "AbsolutePath": "/api/passphrase", "Url": "https://gearssdk.opswat.com/api/passphrase", "AbsoluteUrl": "https://gearssdk.opswat.com/api/passphrase", "Query": {}, "Method": "GET", "Headers": { "Accept": [ "*/*" ], "Host": [ "gearssdk.opswat.com" ], "OPSWAT-Request-Token": [ "189a5e181f0e54fe265c4553a388dbc3e098e73dca178dd5c85fb63d56bb97b16026a471606daca4600b760e950186876f47453a95941d4af2e1b45992dcc309b1646cac587853ca4693d2a257367610ae134a3772a3deada3a9ea57f8930d316cd33f1eb97bbf0609b5cda16274b5c1e603644a4576c8aef3f0aec5e228abab75ce4f468678865e7088dbf6cb27962a484ea6cbb4faa98e31eec7d209b25a292923b9651bbf521258baf0bd1eeda66162fcd2e5e3893cb0a270c09c7c271c466bfe3833f0781ba5d70731c539e55be813520dfb0fb580b1aa92567bd20bcce02f70bcab481fbbe61023f0f1a0bc1a37183120abd43449a294f138cc0ba653e2_a148d79e2f0487d4c592a5577340d522528ad61aa90f92782ea4ae96af6a16dc354dd34c1583639b26cbea62f652c2bd4a778b6a0dc4d89a039322c8fa7c36f6aab873a95299ddb0434aa39bb084ec50aa1a648590c1a5717cb961b7e4e8199e1a5624bc5571a4b1906875373491eb429891425660aa2144c681f5c9b79fc5e0c21f65dde72cde4b9a75af1d31a5e843b941ff7baff9eccbf73477e70f04a7973cc28ff3a507fbf7588f5d9295c4a4c0bf71e55a4a1c1d98a3675b45e62fda9c78d98f8b6152e99e06ec3674519c67463976dfd14c1c3214bfc7d6ea99cd42a42f522e01b61099827630338af824ffeacbd3b3ec8393c8574bdbeb2c488d967f_8e0d3c8802fff2ec07d0375d3d9c372873e6a0b26a43c7ba204214bb09a374ba5a82a28c4be557f68f5b558b0c42615965c034961ebf0ff452d69633ef5e5f5cd2681280599f78f168f4fe4e8b449a271ee436273bb446fa6fef903c05e2633a9cae14ffe3a52ca6e1c1b26e0d6586bc93f973617689945fe5285107bb9c4f049ef4eab30167decc289b14280605feddb1b132f20736c265c2e78278d7bebc1c03bf69c7962a1a2aef49d3e3e59e7174074ab69b597cf5b4cb9058becd39fa36167cc56bfbda5e54534859d472fd370b9d74950139f0fc5cd8c6e8d2e57246ec4ceca22ad0ad5e924c858bf213660d7f1e8e5914aa30284853e7991a7746da72" ] } }, "Response": { "StatusCode": 404, "Headers": { "Content-Type": [ "application/json" ] }, "BodyAsJson": { "Status": "No matching mapping found" }, "DetectedBodyType": 2, "DetectedBodyTypeFromContentType": 0 }, "PartialMappingGuid": "4795d8ec-70b6-4906-9348-aca8de0b50b5", "PartialRequestMatchResult": { "TotalScore": 1.0, "TotalNumber": 2, "IsPerfectMatch": false, "AverageTotalScore": 0.5, "MatchDetails": [ { "Name": "PathMatcher", "Score": 0.0 }, { "Name": "MethodMatcher", "Score": 1.0 } ] } }, { "Guid": "7324228e-6378-4c41-bde3-a74b4fcda7c5", "Request": { "ClientIP": "127.0.0.1", "DateTime": "2021-11-04T15:22:26.148385Z", "Path": "/api/passphrase", "AbsolutePath": "/api/passphrase", "Url": "https://gearssdk.opswat.com/api/passphrase", "AbsoluteUrl": "https://gearssdk.opswat.com/api/passphrase", "Query": {}, "Method": "GET", "Headers": { "Accept": [ "*/*" ], "Host": [ "gearssdk.opswat.com" ], "OPSWAT-Request-Token": [ "aea84a5409404710f03c0fae28fda72ba3766dd4c9a95e6cb99d5bd71bc254c7ad30cb5bdb59f483fb5b7ae2ae70dcad8ffa8cd03b29400bab5a15be600f6d25222b5eec40c8530cb051b26e7a6bdb3e86802bc193a1a70b468810781c4da482a8dd16ecf9457237f90dd97794e7d2f080dc5a3ac5fb37971cdc27857a5f51192b6ecf2f4baeaa554eab3378c13dc0a6098b8023e9a8f03fb8b775565aad6abb96ec2ac4d36c368f3ffc4b98f8d8a6481f873fd24612054ff19ec45b7ad28680b9f39dfafd2b41e0ccb6a7b3e448a7c80fa787e02a862afafbb8092b9e2d8c670886d3c9a5dafe0ce78e131a8126793ba44cb052e4e1cae03154b7226bc83b0d_d72f039d21dd7312a1921bbdc04e98258c1854f2c243ba145375106e796d5a3c5cbd1bd54794b88b9928b9bc2dbd25f4a4259748c0f62e81eee943fd7e7818027f81ecd66947c1f31d175f672944842ea3939cc3d80b6c387b0db264d2cff662f22d71b4323fec2f9f87f2192b3f07f4aa666b82c789ade4bf9f340b17131f78ed9813940ed1b417f0a8333a402e407f9fc73f801946d7ea9f5841f7c7553be998bd7753a993e39d1bf55abb4e5c52b46d54c42b1d017cf561b1361e8bb5c42c7f7b80aa99798afe57212a30a959e86e7b66a4b2b94ece901806e935662ef175e44b2ac53398cf61faae61c66a4c3d9fece378ad7381838533e618ae9eb20838_36e1d58ef662b7baf8dd6105f0fcffeeba88c875b07798ece0ba50ae17e4b55fc9968131a775de0ee5b6fedc1c786bb2b0c61de467b0a3dd78940d6571a56b47cfbd469e84b64bca8d09f6b969872307bf057794dd3b256e08da873cb1f618c0723ce6eb3d9007e2eeecded5ea3b3238359d6cde2c87514f9feb4e911e6db04203efeeb032f2692bc2a3462ec4e8f114106594f95d2705c69c75a731f27e12b9cd3698d85c65f81874250e6d3c70b00d3fce2bb9241ee8895a666a6d849ff4f1ef55ed918587e2de4752141e2a813e10b8c2b3341443c66bc853bf022a0028ed6e3f00b8c689ff45e1662ce5249bd8db8b574775e22c418dab1b8f06ae33f8c1" ] } }, "Response": { "StatusCode": 404, "Headers": { "Content-Type": [ "application/json" ] }, "BodyAsJson": { "Status": "No matching mapping found" }, "DetectedBodyType": 2, "DetectedBodyTypeFromContentType": 0 }, "PartialMappingGuid": "4795d8ec-70b6-4906-9348-aca8de0b50b5", "PartialRequestMatchResult": { "TotalScore": 1.0, "TotalNumber": 2, "IsPerfectMatch": false, "AverageTotalScore": 0.5, "MatchDetails": [ { "Name": "PathMatcher", "Score": 0.0 }, { "Name": "MethodMatcher", "Score": 1.0 } ] } } ] ``` ###Filter And I apply the filter inn the following way (I check in detail de CookieModel): ``` { "Cookies": [{ "Matchers": [ { "Name" : "ExactMatcher", "Pattern": "123" } ], "Name":"session_id" }] } ``` And the result was: [ { "Guid": "ecca4c0e-116c-426a-a04c-5466451fed14", "Request": { "ClientIP": "::1", "DateTime": "2021-11-04T14:50:35.713853Z", "Path": "/states/1", "AbsolutePath": "/states/1", "Url": "http://localhost:8080/states/1", "AbsoluteUrl": "http://localhost:8080/states/1", "Query": {}, "Method": "GET", "Headers": { "Connection": [ "keep-alive" ], "Content-Type": [ "application/json" ], "Accept": [ "*/*" ], "Accept-Encoding": [ "gzip, deflate, br" ], "Cookie": [ "session_id=123" ], "Host": [ "localhost:8080" ], "User-Agent": [ "PostmanRuntime/7.28.4" ], "Content-Length": [ "392" ], "x-api-key": [ "123" ], "Postman-Token": [ "489e4408-90a0-41a1-8e61-d9acc2f6b9a9" ] }, "Cookies": { "session_id": "123" } }, "Response": { "StatusCode": 200, "Headers": { "Content-Type": [ "application/json; charset=UTF-8" ], "Content-Length": [ "105" ], "Date": [ "Tue, 26 Oct 2021 15:41:14 GMT" ] }, "BodyAsJson": { "state": "Scenario 2", "Data": { "person": [ { "id": 1, "name": "Eva Charpman", "age": "33", "Height": "1.63", "gender": "female" } ] } }, "DetectedBodyType": 2, "DetectedBodyTypeFromContentType": 0 }, "MappingGuid": "ed18595b-6fe5-4c27-b04b-8ee2f8d4be10", "MappingTitle": "States & Scenarios", "RequestMatchResult": { "TotalScore": 3.0, "TotalNumber": 3, "IsPerfectMatch": true, "AverageTotalScore": 1.0, "MatchDetails": [ { "Name": "PathMatcher", "Score": 1.0 }, { "Name": "MethodMatcher", "Score": 1.0 }, { "Name": "ScenarioAndStateMatcher", "Score": 1.0 } ] }, "PartialMappingGuid": "ed18595b-6fe5-4c27-b04b-8ee2f8d4be10", "PartialMappingTitle": "States & Scenarios", "PartialRequestMatchResult": { "TotalScore": 3.0, "TotalNumber": 3, "IsPerfectMatch": true, "AverageTotalScore": 1.0, "MatchDetails": [ { "Name": "PathMatcher", "Score": 1.0 }, { "Name": "MethodMatcher", "Score": 1.0 }, { "Name": "ScenarioAndStateMatcher", "Score": 1.0 } ] } } ] I change de cookie filter ``` { "Cookies": [{ "Matchers": [ { "Name" : "ExactMatcher", "Pattern": "456" } ], "Name":"session_id" }] } ``` And I get ``` [ { "Guid": "53a4b3f2-18a0-4db5-a587-f4d744a01bd5", "Request": { "ClientIP": "::1", "DateTime": "2021-11-04T14:55:32.312843Z", "Path": "/states/1", "AbsolutePath": "/states/1", "Url": "http://localhost:8080/states/1", "AbsoluteUrl": "http://localhost:8080/states/1", "Query": {}, "Method": "GET", "Headers": { "Connection": [ "keep-alive" ], "Content-Type": [ "application/json" ], "Accept": [ "*/*" ], "Accept-Encoding": [ "gzip, deflate, br" ], "Cookie": [ "session_id=456" ], "Host": [ "localhost:8080" ], "User-Agent": [ "PostmanRuntime/7.28.4" ], "Content-Length": [ "392" ], "x-api-key": [ "123" ], "Postman-Token": [ "be95a919-e7f5-4cc2-ab27-3de6f5d2f1c5" ] }, "Cookies": { "session_id": "456" } }, "Response": { "StatusCode": 200, "Headers": { "Content-Type": [ "application/json; charset=UTF-8" ], "Content-Length": [ "105" ], "Date": [ "Tue, 26 Oct 2021 15:41:14 GMT" ] }, "BodyAsJson": { "state": "Scenario 3", "Data": { "person": [ { "id": 1, "name": "Eva Charpman", "age": "33", "Height": "1.63", "gender": "female" } ] } }, "DetectedBodyType": 2, "DetectedBodyTypeFromContentType": 0 }, "MappingGuid": "10baedbb-2cb6-4dae-a96b-5a4d07780aac", "MappingTitle": "States & Scenarios", "RequestMatchResult": { "TotalScore": 3.0, "TotalNumber": 3, "IsPerfectMatch": true, "AverageTotalScore": 1.0, "MatchDetails": [ { "Name": "PathMatcher", "Score": 1.0 }, { "Name": "MethodMatcher", "Score": 1.0 }, { "Name": "ScenarioAndStateMatcher", "Score": 1.0 } ] }, "PartialMappingGuid": "10baedbb-2cb6-4dae-a96b-5a4d07780aac", "PartialMappingTitle": "States & Scenarios", "PartialRequestMatchResult": { "TotalScore": 3.0, "TotalNumber": 3, "IsPerfectMatch": true, "AverageTotalScore": 1.0, "MatchDetails": [ { "Name": "PathMatcher", "Score": 1.0 }, { "Name": "MethodMatcher", "Score": 1.0 }, { "Name": "ScenarioAndStateMatcher", "Score": 1.0 } ] } }, { "Guid": "6cc01bd6-470d-41ed-9be6-98629fba3617", "Request": { "ClientIP": "::1", "DateTime": "2021-11-04T15:09:49.983713Z", "Path": "/states/1", "AbsolutePath": "/states/1", "Url": "http://localhost:8080/states/1", "AbsoluteUrl": "http://localhost:8080/states/1", "Query": {}, "Method": "GET", "Headers": { "Connection": [ "keep-alive" ], "Content-Type": [ "application/json" ], "Accept": [ "*/*" ], "Accept-Encoding": [ "gzip, deflate, br" ], "Cookie": [ "session_id=456" ], "Host": [ "localhost:8080" ], "User-Agent": [ "PostmanRuntime/7.28.4" ], "Content-Length": [ "392" ], "x-api-key": [ "123" ], "Postman-Token": [ "d14e9bcc-b82f-463e-b729-f946fdc199b0" ] }, "Cookies": { "session_id": "456" } }, "Response": { "StatusCode": 200, "Headers": { "Content-Type": [ "application/json; charset=UTF-8" ], "Content-Length": [ "105" ], "Date": [ "Tue, 26 Oct 2021 15:41:14 GMT" ] }, "BodyAsJson": { "state": "Scenario 1", "Data": { "person": [ { "id": 1, "name": "Eva Charpman", "age": "33", "Height": "1.63", "gender": "female" } ] } }, "DetectedBodyType": 2, "DetectedBodyTypeFromContentType": 0 }, "MappingGuid": "d7c25ef5-6e88-43ff-96fc-2116850ab14b", "MappingTitle": "States & Scenarios", "RequestMatchResult": { "TotalScore": 3.0, "TotalNumber": 3, "IsPerfectMatch": true, "AverageTotalScore": 1.0, "MatchDetails": [ { "Name": "PathMatcher", "Score": 1.0 }, { "Name": "MethodMatcher", "Score": 1.0 }, { "Name": "ScenarioAndStateMatcher", "Score": 1.0 } ] }, "PartialMappingGuid": "d7c25ef5-6e88-43ff-96fc-2116850ab14b", "PartialMappingTitle": "States & Scenarios", "PartialRequestMatchResult": { "TotalScore": 3.0, "TotalNumber": 3, "IsPerfectMatch": true, "AverageTotalScore": 1.0, "MatchDetails": [ { "Name": "PathMatcher", "Score": 1.0 }, { "Name": "MethodMatcher", "Score": 1.0 }, { "Name": "ScenarioAndStateMatcher", "Score": 1.0 } ] } } ] ``` Thanks a lot!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/WireMock.Net-wiremock#381