Skip to content

Latest commit

 

History

History
60 lines (50 loc) · 2.34 KB

File metadata and controls

60 lines (50 loc) · 2.34 KB
Introduction

The idea behind this project was to build an API that could complete the basic CRUD operations on 'longboard' objects that are stored in a Shelve database. The following is the base 'longboard' object:

{
    "id": "XXX",
    "name": "XXXXX",
    "length": "XX",
    "width": "XX"
}
Project Structure

The project is divided into two sections:

  1. Java
    On the Java side is the swift GUI and the HTTP methods using Unirest that are used by the GUI.
  2. Python
    On the Python side is the API itself. It is built with Flask and Flask-RESTful. In order to run the Java GUI, the Flask application is run locally.
Options

The following are the possible endpoints and their possible requests:

  • To all longboards-
    GET /longboards
    POST /longboards
    OPTIONS /longboards
    DELETE /longboards

  • To a specific longboard-
    GET /longboard/{identifier}
    HEAD /longboard/{identifier}
    DELETE /longboard/{identifier}
    PUT /longboard/{identifier}
    PATCH /longboard/{identifier}
    OPTIONS /longboard/{identifier}

Status Codes

I determined which status code to return based on the following information provided here.

  • 200 OK
    Standard response for successful HTTP requests.
  • 201 Created
    The request has been fulfilled, resulting in the creation of a new resource.
  • 204 No Content
    The server successfully processed the request and is not returning any content.
  • 400 Bad Request
    The server cannot or will not process the request due to an apparent client error
  • 404 Not Found
    The requested resource could not be found but may be available in the future.
Acknowledgments

There are two main sources of information that helped me incredibly: Jake Wright and Assertible. Thanks for helping me learn more about APIs!

Links to images:

Links to sounds: