Is it possible to see the full request body so I c...
# pact-broker
j
Is it possible to see the full request body so I can determine what the error message was for a verification failure?
I'm seeing this in the logs but it's not expanding the body object
Copy code
2024-02-01T21:56:29.950708Z  INFO ThreadId(11) pact_verifier::provider_client: Received response: HTTP Response ( status: 404, headers: Some({"date": ["Thu, 01 Feb 2024 21:56:29 GMT"], "x-response-time": ["4ms"], "content-type": ["text/plain; charset=utf-8"], "content-length": ["9"], "connection": ["close"], "x-powered-by": ["Express"]}), body: Present(9 bytes, text/plain;charset=utf-8) )
b
Assuming you mean you’re looking for the response body: can’t you just replay the request using a tool like Postman and see what happens?
m
We don’t actually capture and store that in PactFlow, although I can see why that would be valuable.
It is shown at DEBUG level though, I believe
j
I'm using rest client for vscode and that's working but it'd be nice to see the exact request and response happening in the test. Ok I'll try setting debug logs
👍 1
m
Usually when I see this, it’s a provider state not being setup correct and a 404 or endpoint is being hit that wasn’t expected by the provider
But that’s just a first pointer
j
Yeah there's definitely something up with the record not being in the downstream api mock, I think I can fix it
👍 1
Pact is forcing me to learn backend development so this is taking me a minute lol
m
haha no worries
I think the point above is a good one though. I think their is likely a feature request for it, I’ll add your vote to it
thankyou 1
If you could please cast your vote here also: https://pact.canny.io/feature-requests/p/cache-provider-contract-on-pact-broker We have an internal tracking one for PactFlow too
j
I voted for it! Also added my own comment explaining that we don't even need the physical pact file necessarily, just the request/response pairs that get actually sent during verification. So I could do something like
Copy code
.verifyPacts((req, res) => {console.log(req.body)})
thankyou 1
m
Thanks!