mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-29 07:21:27 +00:00
Added alternative JSON response serialization
This commit is contained in:
parent
cc46c37c78
commit
d7a6b3ca12
9
main.py
9
main.py
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
from flask import Flask, jsonify, request
|
from flask import Flask, jsonify, request, json
|
||||||
from flask_restful import Resource, Api, reqparse
|
from flask_restful import Resource, Api, reqparse
|
||||||
import base64
|
import base64
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
@ -22,7 +22,12 @@ def getDkimKey():
|
||||||
dkim = base64.b64encode(dkim)
|
dkim = base64.b64encode(dkim)
|
||||||
dkim = str(dkim, 'utf-8')
|
dkim = str(dkim, 'utf-8')
|
||||||
print(dkim)
|
print(dkim)
|
||||||
return "1" #jsonify(dkim)
|
response = app.response_class(
|
||||||
|
response=json.dumps(dkim),
|
||||||
|
status=200,
|
||||||
|
mimetype='application/json'
|
||||||
|
)
|
||||||
|
return response
|
||||||
@app.route("/pythonVersion", methods=["GET"])
|
@app.route("/pythonVersion", methods=["GET"])
|
||||||
def getPythonVersion():
|
def getPythonVersion():
|
||||||
pythonVersion = subprocess.check_output(["python","--version"])
|
pythonVersion = subprocess.check_output(["python","--version"])
|
||||||
|
|
Loading…
Reference in a new issue