Beispiel #1
0
def hello():
    if checkAcceptIsJson(request) and checkContentIsJson(request):
        setResponseContentTypeJson(response)
        hello = HelloWorld.fromJson(parseRequestToJson(request))
        return parseObjectToJson(hello)
    else:
        return abort(404)
Beispiel #2
0
def quoteoftheday():
    if checkAcceptIsJson(request) and checkContentIsJson(request):
        setResponseContentTypeJson(response)
        json = parseRequestToJson(request)
        updatedQuote = QuoteOfDay.update(author = json['author'], quote = json['quote'], date = date.today().isoformat()).where(QuoteOfDay.id == 1)
        updatedQuote.execute()
    else:
        return abort(404)
Beispiel #3
0
def getmath():
    if checkAcceptIsJson(request) and checkContentIsJson(request):
        setResponseContentTypeJson(response)
        return parseObjectToJson(MathOperation.fromJson(parseRequestToJson(request)))
    else:
        return abort(404)