Add environments feature similar to paw's. At minimum an environment should define URL and headers. It may make sense to have templates in environments but that can be done later. For example, one can have production and local environment. Following is example config if you are developing github API:
config = {
"name": "github",
"description": "Github API",
"environments": {
"production": {
"uriprefix": "https://api.github.com",
"default": true,
"headers": {"Authorization": {"env": "GITHUB_PROD_AUTH"}}
},
"local": {
"uriprefix": "http://localhost:4000",
"headers": {"Authorization": {"env": "GITHUB_LOCAL_AUTH"}}
},
},
"headers": {
"accept": "application/json",
"content-type": "application/json"
},
}
Here, there are global headers which will be merged with environment specific headers with env ones taking precedence.
There can be --env option that has default environment when not provided which in above is config is production. Have --set-default-env option that will change the default env.
Add environments feature similar to paw's. At minimum an environment should define URL and headers. It may make sense to have templates in environments but that can be done later. For example, one can have production and local environment. Following is example config if you are developing github API:
Here, there are global headers which will be merged with environment specific headers with env ones taking precedence.
There can be
--envoption that hasdefaultenvironment when not provided which in above is config isproduction. Have--set-default-envoption that will change the default env.