James Troughton
03/02/2022, 11:58 AMA pact between Example App and Example API
that has been given. I am making a request to
curl --location --request GET 'https://{myDomain}.<http://pactflow.io/pacts/provider/Example|pactflow.io/pacts/provider/Example> API/consumer/Example App/latest/stub/alligators/Mary' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {token}'
But I am getting a 400 Bad Request back, what am I doing wrong?Yousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
/alligators/mary
I've just tried it against mine to retrieve a pact and it worked fine
curl --location --request GET '<https://you54f.pactflow.io/pacts/provider/example%20provider/consumer/example%20consumer/version/LOCAL_DEV>' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer xyz'
Will test it with the /stub/
endpoint and let you knowJames Troughton
03/02/2022, 1:13 PMYousaf Nabi (pactflow.io)
curl -v --location --request GET '<https://you54f.pactflow.io/pacts/provider/example%20provider/consumer/example%20consumer/latest/stub/dogs>' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer xyz'
Let me go through the post above and run through it 🙂Yousaf Nabi (pactflow.io)
James Troughton
03/02/2022, 1:22 PM{
"consumer": {
"name": "Example App"
},
"provider": {
"name": "Example API"
},
"interactions": [
{
"_id": "ef69ceef4d7fb82af014da950a3d9028a905c4de",
"description": "a request for an alligator",
"providerState": "there is an alligator named Mary",
"request": {
"method": "get",
"path": "/alligators/Mary",
"headers": {
"Accept": "application/json"
}
},
"response": {
"status": 200,
"headers": {
"Content-Type": "application/json;charset=utf-8"
},
"body": {
"name": "Mary"
},
"matchingRules": {
"$.body.name": {
"match": "type"
}
}
}
},
{
"_id": "4b3c23c364f420e1d1296d56a47695de0428d0af",
"description": "a request for an alligator",
"providerState": "there is not an alligator named Mary",
"request": {
"method": "get",
"path": "/alligators/Mary",
"headers": {
"Accept": "application/json"
}
},
"response": {
"status": 404,
"headers": {}
}
},
{
"_id": "e57e7ac251a8bd078fcb81cad1e577cbafebcef5",
"description": "a request for an alligator",
"providerState": "an error occurs retrieving an alligator",
"request": {
"method": "get",
"path": "/alligators/Mary",
"headers": {
"Accept": "application/json"
}
},
"response": {
"status": 500,
"headers": {
"Content-Type": "application/json;charset=utf-8"
},
"body": {
"error": "Argh!!!"
}
}
}
],
"metadata": {
"pactSpecification": {
"version": "2.0.0"
}
},
"createdAt": "2022-03-01T21:09:21+00:00"
}
Beth (pactflow.io/Pact Broker/pact-ruby)
Andre Rodrigues
03/09/2022, 4:04 PM