Spaces:
Runtime error
Runtime error
Commit
·
41d788a
1
Parent(s):
cfb7e96
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,20 +1,8 @@
|
|
| 1 |
-
import
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
def proxy(path):
|
| 8 |
-
url = 'https://vk.com/mackorlabs' + path
|
| 9 |
-
headers = {'Content-Type': 'application/json'}
|
| 10 |
-
response = requests.request(
|
| 11 |
-
method=request.method,
|
| 12 |
-
url=url,
|
| 13 |
-
headers=headers,
|
| 14 |
-
data=request.get_data(),
|
| 15 |
-
cookies=request.cookies,
|
| 16 |
-
stream=True,
|
| 17 |
-
)
|
| 18 |
-
return response.content, response.status_code, response.headers.items()
|
| 19 |
if __name__ == '__main__':
|
| 20 |
-
app.run(host='0.0.0.0', port=
|
|
|
|
| 1 |
+
from flask import Flask, request
|
| 2 |
+
app = Flask(__name__)
|
| 3 |
+
@app.route('/', methods=['POST'])
|
| 4 |
+
def handle_post_request():
|
| 5 |
+
data = request.get_data(as_text=True)
|
| 6 |
+
return f'Received POST request with data: {data}'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
if __name__ == '__main__':
|
| 8 |
+
app.run(host='0.0.0.0', port=5000)
|