manishtomar / crest Goto Github PK
View Code? Open in Web Editor NEW"Curl"REST - A generic CLI to access any RESTful service with a little bit of configuration.
License: MIT License
"Curl"REST - A generic CLI to access any RESTful service with a little bit of configuration.
License: MIT License
Have an option like --no-store
which if given will tell crest to not store the sent request in history. The request sent will also be removed from ~/.crest/<service>/.tmpbody
. This is similar to #5 except that this option will be given along the request. A better variation of this would be to provide this option in config file which makes it a service level option.
How can this be a command line interface for any rest api if it doesn't parse wadl files?!
crest
should have -v
option that similar to curl or wget or it can have --print-headers
option that prints headers being sent. May need to think more on this.
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.
Should work in any case. If no option results in any pre-populated data, then it should open editor with empty content.
There should be an option like --del-history
that takes the item number and deletes it. This is useful if the HTTP request sent contains sensitive information like password or API key. However, this same info can also be there in ~/.crest/<service>/.tmpbody
also. So, I think the option should delete its content too.
Add an option to spit out the equivalent curl
command to run the same API call. This would be good for users learning the API, or just curious what the call would be like in it's entirety.
One should be able to update config of already installed service by doing crest --install-service sconf.py
. It should just replace existing config without touching history.
Have an config option to limit size of history of a service. When the limit is reached the last ones will be removed.
Since config is basically python file, there should be facility to specify functions that will get executed to generate parts of request or headers. For example
"headers": {
"content-type": "application/json",
"accept": "application/json",
"X-Auth-Token": get_auth_token
},
get_auth_token
will be a function that will generate auth token every time.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.