■ Issue
- curl succeeds: 200 OK
- Laravel HTTP Client fails: 500 “Mock data not found”
- Same endpoint, same payload
■ Environment
■ Success Case (curl)
curl -X POST 'URL' -H 'Accept: application/json' -d 'search=Labor'
→ 200 OK
■ Failure Case (Laravel)
Http::asForm()->post('URL', ['search' => ['Labor']])
→ 500 "Mock data not found"
■ Actual Payload
Both send the same: search=Labor
■ Question
Why does only the Laravel HTTP Client fail?
Could you please explain the request matching conditions?
Thank you for your assistance.
You can try this:
Http::asForm()->acceptJson()->post('URL', ['search' => 'Labor']);
Please tell us that way will work or not 
I have made the above corrections, but I am still receiving a 500 error from Apidog’s cloud mock…
errMsg: Mock data not found for this request.
Below is the information for the mock headers:
- Accept: /
- Content-Type: application/x-www-form-urlencoded
For now, the issue was solved by using Guzzle directly instead of the Laravel HTTP Client. Do you think it’s okay to proceed with Guzzle?
Hello, could you please confirm two things to help us better identify the issue? First, does the Laravel code ( Http::asForm()->post(…) ) come from Actual Request - Client Code? Second, would you mind sharing a screenshot of your endpoint? Additionally, you can compare the data packets of the two requests (the failed one and the successful one) by packet capture. This will help us spot specific differences between them.