Sandy May
08/07/2024, 6:33 PMapplication/x-www-form-urlencoded
The incoming body has been transformed into a format that isn't x-www-form-urlencoded. Is there anything obvious that I've done? I can't find many examples of this Content-Type.
Request body in pact file: "grant_type=client_credentials"
See the incoming request going to our mock server:
[19:26:50.985] DEBUG (89255): pact@13.1.1: incoming request: {"body":{"grant_type=client_credentials":""},"headers":{"content-type":"application/x-www-form-urlencoded","authorization":"Basic badDummySecret","accept":"*/*","accept-encoding":"gzip, deflate","host":"127.0.0.1:53453","content-length":"31"},"method":"POST","path":"/token"}
Minimal pact file in comments. Thanks!Sandy May
08/07/2024, 6:34 PM{
"consumer": {
"name": "Consumer"
},
"interactions": [
{
"_id": "52ca544e-b410-490d-8643-df13b8ca4648",
"description": "Invalid basic auth credentials",
"providerStates": [
{
"name": "badDummySecret is not a valid basic auth secret"
},
{
"name": "mockComponentId is the component ID"
}
],
"request": {
"body": "grant_type=client_credentials",
"headers": {
"Authorization": "Basic badDummySecret",
"Content-Type": "application/x-www-form-urlencoded"
},
"method": "POST",
"path": "/token"
},
"response": {
"status": 400
}
}
],
"metadata": {
"pact-jvm": {
"version": "4.6.5"
},
"pactSpecification": {
"version": "3.0.0"
}
},
"provider": {
"name": "Provider"
},
"createdAt": "2024-07-10T15:32:48+00:00"
}Matt (pactflow.io / pact-js / pact-go)
Sandy May
08/08/2024, 7:28 AMMatt (pactflow.io / pact-js / pact-go)
Slackbot
08/08/2024, 7:34 AMSandy May
08/08/2024, 7:37 AMSandy May
08/08/2024, 3:27 PM