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

introduce REST API #165

Open
typekpb opened this issue Nov 7, 2013 · 1 comment
Open

introduce REST API #165

typekpb opened this issue Nov 7, 2013 · 1 comment

Comments

@typekpb
Copy link

typekpb commented Nov 7, 2013

I like the idea of saving the form config, however to make things even more comfortable, I'd like to see REST API.

My understanding of REST API would be:

  • URL is the only input
  • returned response would be the output (the same result as is currently returned once I fill the form and click "Generate" button)
  • no need to run the url in browser (wget/curl) should do the job as well

Then I could generate the data with simple wget/curl GET/POST call. That would basically mean, I would not need anything except URL to remember. This would make generatedata stateless, I could run the URL on any server where the generatedata is installed.

To make things easy and reproducible, extra field could be auto-generated/auto-updated on web site, showing the query to run for the same result.

The next step would be some flag in URL to decide:

  • just prefill the site form and display or
  • generate data and return in HTTP response
@benkeen
Copy link
Owner

benkeen commented Nov 9, 2013

Yeah, this is a terrific idea!

  • First, we'd need to send POST requests, not just GET. GET would be great, but to be able to specify precisely what you need in a data set, any request would get uber-long, really fast - pushing it over the 3 or so thousand chars generally allowed in query strings.
  • Each module would need to be well-defined and specify exactly what options are available for it. That way, the API users would know how to construct the request to send to the API.
  • Speaking practically, perhaps the existing generator could also output a REST call version of the data set so it would effectively act as a generator for the REST requests themselves as well? That would allow developers to quickly construct the REST request, which they could tweak programmatically if they wanted.

Definitely a fair bit of work, but I think it would be worthwhile... I'll give it some thought.

Ben

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants