Giter Site home page Giter Site logo

http_server_for_feedback's Introduction

  1. To run the server the following command should be executed: server.py [port]

    The default port is 2222.

    The URL of a server is localhost:port.

  2. The API allows fetching data from a database. It can be accessed through /api. In order to run a query the "firstname", "lastname", "email" and "ops" parameters should be provided in the following fashion:

    http://localhost:2222/api?firstname=Jerry&lastname=Clarkson&[email protected]&ops=%26%7C

    The "ops" parameter provides necessary AND and OR boolean operations for the query. AND should be encoded as %26 (decodes to &). OR should be encoded as %7C (decodes to |).

    NOTE! The API considers the order of parameters provided. Thus, the following two queries will return different results: http://localhost:2222/[email protected]&firstname=Jerry&lastname=Clarkson&ops=%26%7C (translates to WHERE email=[email protected] AND firstname = Jerry OR lastname = Clarkson) http://localhost:2222/api?firstname=Jerry&lastname=Clarkson&[email protected]&ops=%26%7C (translates to WHERE firstname = Jerry AND lastname = Clarkson OR email=[email protected]) The relative position of the "ops" parameter in the query does not matter.

    Also, the various number of parameters can be provided. For example, the following queries will be valid: http://localhost:2222/api?firstname=Jerry&lastname=Clarkson&ops=%26 http://localhost:2222/api?firstname=Jerry

#Update 1: Added support for JSON POST requests for the API. The "ops" property of the JSON object now defines boolean operators placed between parameters in the following strict order: "email" "firstname" "lastname".

api_client.py allows to send simple JSON POST requests. 
Usage: api_client.py [--url server_url] --firstname FirstName --lastname LastName --ops BoolOperators  

http_server_for_feedback's People

Contributors

bnurbekov avatar

Watchers

James Cloos avatar  avatar  avatar

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.