Commit 4fa8a2e5 authored by Łukasz Nowak's avatar Łukasz Nowak

Follow REST API.

Return 201 Created instead of 200 OK, whichis correct PUT response.

Ref: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
parent f89aab61
...@@ -17,7 +17,7 @@ import hashlib ...@@ -17,7 +17,7 @@ import hashlib
import os import os
import sys import sys
import traceback import traceback
from flask import Flask, request, helpers, abort from flask import Flask, request, helpers, abort, make_response
from config import NetworkcacheConfiguration, NetworkcacheParser from config import NetworkcacheConfiguration, NetworkcacheParser
...@@ -42,7 +42,7 @@ def put(): ...@@ -42,7 +42,7 @@ def put():
app.logger.info(traceback.format_exc()) app.logger.info(traceback.format_exc())
abort(500, "Faile to upload the file.") abort(500, "Faile to upload the file.")
return 'Success' return make_response('Success', 201)
@app.route('/<key>', methods=['GET']) @app.route('/<key>', methods=['GET'])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment