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

WebAPI syntax thoughts #61

Open
sylviesworld opened this issue May 18, 2021 · 0 comments
Open

WebAPI syntax thoughts #61

sylviesworld opened this issue May 18, 2021 · 0 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@sylviesworld
Copy link
Contributor

@audris I had a thought on how to streamline the syntax for the webAPI but I'm concerned about it deviating too much from how the actual scripts are executed. Right now, to execute this showCnt command: echo 009d7b6da9c4419fe96ffd1fffb2ee61fa61532a | showCnt.perl commit in the webAPI you do: curl "https://worldofcode.org/webAPI/showCnt?sha1=009d7b6da9c4419fe96ffd1fffb2ee61fa61532a&type=commit"

There are two problems that I have with this syntax:

  1. If you provide more than one variable, you have to wrap the address in quotes
  2. Multiple fields can be more confusing and a lot longer

My thoughts is that we change the way we call the webAPI to: curl https://worldofcode.org/webAPI/showCnt?commit=009d7b6da9c4419fe96ffd1fffb2ee61fa61532a
The key difference here is that instead of using a field for sha1 and a field for type, I instead specified my input as a commit and set it equal to the sha1, essentially keying the sha1 with the type. So another example for a tree would be: curl http://localhost:3000/webAPI/showCnt?tree=464ac950171f673d1e45e2134ac9a52eca422132

What are your thoughts on this?

@sylviesworld sylviesworld added enhancement New feature or request question Further information is requested labels May 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant