Hi! Does anyone know where the documentation for t...
# pact-python
a
Hi! Does anyone know where the documentation for the body of the POST request of the provider setup url parameter is? I get the following body:
Copy code
{
  "consumer": "Consumer",
  "state": "User exists and has resources",
  "states": [
    "User exists and has resources"
  ],
  "params": {}
}
m
You only need to use that "state" string to identify what state it should be in, the body is empty. If you look in https://github.com/pact-foundation/pact-python/blob/master/examples/fastapi_provider/tests/pact_provider.py there's an example with state "UserA does not exist" -> call the function setup_no_user_a()
u
hi @Mike Geeves I’m trying to reason with myself how that’s useful if we’re not getting anything in the body for a POST request. I thought the point of the provider was to actually use everything the consumer will send with the request against the provider
oh nvm, I get it now. It makes a call to my custom pact_provider_state endpoint then makes the real call to the provider server
👍 1
m
Yes that way you can do the consumer part first, you don't need knowledge of the provider implementation, it's a problem for the provider to worry about, only the expectation that the provider can implement an appropriate state