I'm trying to apply contract testing on an POST API(Microservice). I've written the consumer side test cases and the pact is generated and now I'm trying to verify the pact on provider side using pact-python. But I cannot see any option to enter the input body payload for the POST call to the API. So far I have this
pact-verifier --provider-base-url=https://localhost:14001/api/v1/htf
--pact-url=howToSolve-howToFix.json
I also tried creating the provider state app using flask but found no option for entering input body payload.
Note : Have to use python only!
You should already created a consumer test. The consumer test defines the interactions that the provider should implement. When you author a consumer test, Pact stands in (mocks) the provider. All of the interactions between the consumer and the mock are recorded into a pact file.
When you run the provider test, Pact stands in for the consumer - so it will read the contents of the pact file, and issue the requests defined in it against your running provider.
So to answer your question, you don't "enter the input body payload for the POST call to the API" - Pact will make the request for you (assuming it was defined in the consumer test in the first place).
Read more here: