Coder Social home page Coder Social logo

crest's People

Contributors

manishtomar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

crest's Issues

Option to not store request

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.

better verbose support

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.

Environments

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.

Option to delete history

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 `--curl` option

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.

Update config of installed service

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.

Limit history

Have an config option to limit size of history of a service. When the limit is reached the last ones will be removed.

execute code from config file

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.