From 88ede6fa657d543e134823b7950584e1f88db0dd Mon Sep 17 00:00:00 2001 From: Chakib Benziane Date: Fri, 15 Mar 2019 19:18:07 +0100 Subject: [PATCH] Update --- README.md | 27 +++++++++++++++++++++++++++ server | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bd82760..546b608 100644 --- a/README.md +++ b/README.md @@ -47,3 +47,30 @@ The go server will be find in the server folder. To Run it use: > make > ./bit4sat ``` + +## API + +These are the currently available API endpoints: + +- `POST` on `/upload`: +Accept a form with content type `application/json` with following structure: +``` json +{ + "files": { + "name": "this is the name/path of file (required)", + "size": "size of file (not required)", + "sha256": "sha256 (not required)" + }, + "timestamp": "timestamp as in Date().toJSON() in js" +} +``` + +Example API call: +``` bash +curl -sX POST \ Fri 19:10 + --header 'content-type: application/json' 'localhost:8880/upload/' \ + --data '{"files":[], "timestamp": "2012-04-23T18:25:43.511Z" }' + +``` + + diff --git a/server b/server index e449299..0515af0 160000 --- a/server +++ b/server @@ -1 +1 @@ -Subproject commit e449299304a972916662b67a2cec98f9f5156e87 +Subproject commit 0515af012932878cd637bb7b9ee871f263cf4359