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

Configuration request and response from JSON file #60

Closed
patsevanton opened this issue Nov 17, 2019 · 1 comment
Closed

Configuration request and response from JSON file #60

patsevanton opened this issue Nov 17, 2019 · 1 comment

Comments

@patsevanton
Copy link

patsevanton commented Nov 17, 2019

Hello.
Can support import request and response from JSON file configuration?
For example:

{
    "request": {
        "method": "GET",
        "url": "/test"
    },
    "response": {
        "status": 200,
        "body": "test 200 OK\n"
    }
}

Examples run

curl http://localhost/test
test 200 OK
@h2non
Copy link
Owner

h2non commented Nov 20, 2019

Not natively, but you can easily parse a JSON input and map its definitions into proper gock instances. As this feature is not a native responsibility of gock, there are no plans to support it.

@h2non h2non closed this as completed Nov 20, 2019
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

2 participants