Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use JSON() as post body matcher, does the order of fields in the body affect matching result #109

Open
CodeplayerGm opened this issue Apr 28, 2023 · 1 comment

Comments

@CodeplayerGm
Copy link

sample:
gock.New("https://gitlab.com").
Post("/oauth/token").
Persist().
//JSON(map[string]interface{}{
// "client_id": "12345",
// "client_secret": "12345",
// "code": "mock_code",
// "grant_type": "authorization_code"
//}).
Reply(200).
SetHeader("Content-type", "application/json; charset=utf-8").
BodyString(accessTokenBody)

what if the real request body has different order
{
"client_id": "12345",
"code": "mock_code",
"client_secret": "12345",
"grant_type": "authorization_code"
}

@CodeplayerGm
Copy link
Author

is it possible to provide a tool to transfer request cmd(curl) to code template?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant