Giter Club home page Giter Club logo

web-service's Introduction

Web-Service

cdf: g5natjia

email: [email protected]

Eight RESTful APIs are available for use. The first six can be accessed using HTTP GET requests, while the last two require HTTP POST requests.

Note: the format of published_date would be YYYY-MM-DDTHH:MM:SS-MM:SS, where the "T" in the middle stands for time, and minutes and seconds are a range.

GET:

  • url: /text-articles;
  • return: a list of articles;
  • fields: title, abstract, published_date, and short_url.
  • url; /authors;
  • return: a list of authors;
  • field: author;
  • note: One author field may contain more than one authors, separated by " And ".
  • url: /urls;
  • return: a list of urls grouped by published dates;
  • fields: published_date, short_urls;
  • note: published dates are not sorted.
  • url: /tags;
  • return: a list of all the tags;
  • field: des_facet;
  • note: some tags may appear more than once.
  • url: /article/ + index;
  • return: an article specified by index;
  • fields: section, subsection, title, abstract, byline, published_date, des_facet;
  • note:
    • index should be a positive interger;
    • null is returned if index is not valid;
    • returned value is enclosed in index 0 of an array, so use [0] to access it
  • url: /media-articles;
  • if multimedia(images) exist:
    • return: a list of articles with images and url linking to the original article;
    • fields: multimedia, short_url;
      • subfields of multimedia: url, caption, width, height;
    • note: multimedia may contain more than one images;
  • else:
    • return: a list of articles with title and url linking to the original article;
    • fields: title, short_url.

POST:

  • url: /;
  • funcion: allow users to sign up (if the username does not exist) or log in;
  • return:
    • "Signed up";
    • "Logged in";
    • "Wrong password";
  • note:
    • highly recommend using a form to transfer the information;
    • when setting up the form, the username should have name uname, and the password should have pwd as name;
    • passwords are hashed at server-side using a hash function similar to hashCode() in Java.
  • url: /feedback;
  • function: allow users to submit feedback regarding this webpage, which will not associated with this user;
  • return: none;
  • note: only logged in users can submit feedback; this is to prevent spam.

web-service's People

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.