Skip to content

Clotho Internals : REST API

David Tran edited this page May 24, 2017 · 1 revision

REST API

As of now, most up to date is on branch gr8clotho

Source:
src/main/java/org/clothocad/webserver/jetty/RestApi.java
Tests & example usage :
src/test/java/org/clothocad/core/util/RESTTester.java

The endpoint where the REST API can be accessed is: localhost:8443/data

  • The port can be specified in your .clothoconfig file in your home directory
    • Ex: /home/djtran/.clothoconfig/

Summary

Most of the REST API can be discovered/explained by exploring the actual REST API Documentation

The REST API handles incoming HTTP requests and redirects them to the rest of the application to be handled. It then takes the output, forms a response, and then sends it back to whichever client made the request.

The request is parsed based on the URL, and the body of the request is read in ways corresponding to which request was parsed.

When to look/work here

If you want to add functionality to the REST API, you need to add an endpoint to the API and can add something based on the existing structure based around GET, POST, etc.

If an endpoint is producing unexpected behavior or the structure of your response isn't as expected, chances are something went wrong here and needs to be fixed.

Clone this wiki locally