Hi, out of interest does the PactDslWithProvider `...
# pact-jvm
j
Hi, out of interest does the PactDslWithProvider
query
parameter url encode the variables it is sent? I have a service which sends a uri encoded value to another service
"from=2022-04-11T09%3A52%3A59%2B0100"
as a query parameter in the path. If I try and do a comparison using this value then it fails with an unexpected request error. However, if I wrap the query parameter in a uri decode statement then the request matches. When I send the http request, I just enter the value specified and thats enough to match. UPDATE: I've just found the
encodedQuery
param which has sorted out me having to encode the query, however the json I have generated does not have the encoded version
u
When you say generated JSON, do you mean in the Pact file?
j
Yes
The output is
Copy code
"query": {
          "from": [
            "2022-04-11T09:52:59+0100"
          ]
        }
Instead of
Copy code
"query": {
          "from": [
            "2022-04-11T09%3A52%3A59%2B0100"
          ]
        }
u
It will be stored unencoded in the Pact file. The reason is that most HTTP clients will encode the query parameters, so if it is stored encoded in the Pact file it will end up being double encoded when used