From 71d69f0ea818d5dc06556481f0412e59333d6ad2 Mon Sep 17 00:00:00 2001 From: Antonio Muniz Date: Sat, 1 May 2021 12:15:43 -0300 Subject: [PATCH] Send images as dataURI --- assets/public/post.html | 52 +++++++++++++++++++++++++++++------------ assets/public/put.html | 45 +++++++++++++++++++++++++---------- methods/POST.py | 5 ++-- methods/PUT.py | 1 + 4 files changed, 74 insertions(+), 29 deletions(-) diff --git a/assets/public/post.html b/assets/public/post.html index fe7e4b4..1134c8d 100644 --- a/assets/public/post.html +++ b/assets/public/post.html @@ -5,15 +5,15 @@ - + Add new - + - + @@ -73,7 +73,10 @@

Add a new friend

+ placeholder="Link to image" style="display:none">
+ Card image cap +
+


@@ -82,7 +85,7 @@

Add a new friend


@@ -96,9 +99,9 @@

Add a new friend

- - - + + + @@ -108,7 +111,7 @@

Add a new friend

- + \ No newline at end of file diff --git a/assets/public/put.html b/assets/public/put.html index 660fbed..47fc22b 100644 --- a/assets/public/put.html +++ b/assets/public/put.html @@ -5,15 +5,15 @@ - + Add New - + - + @@ -71,9 +71,12 @@

Update data of your friend:
- +
+ placeholder="Link to image" style="display:none"> + Card image cap +
+


@@ -91,9 +94,9 @@

Update data of your friend: - - - + + + @@ -103,7 +106,7 @@

Update data of your friend: - + \ No newline at end of file diff --git a/methods/POST.py b/methods/POST.py index b285cf0..cc0ee72 100644 --- a/methods/POST.py +++ b/methods/POST.py @@ -16,11 +16,12 @@ def response(request): if data["name"] != "" and data["phone"] != "" and data["pokemon"] != "" and data["image"] != "": obj = UserObj.fromDict(data) - print(obj) - obj.setId(datetime.datetime.now().strftime("%d%m%Y%H%M%S")) + print(datetime.datetime.now().strftime("%d%m%Y%H%M%S")) status = HandlerDatabase.insertPokemon(obj) + print(status) + header = { "Connection": "Closed" } diff --git a/methods/PUT.py b/methods/PUT.py index da39b3b..90e7057 100644 --- a/methods/PUT.py +++ b/methods/PUT.py @@ -14,6 +14,7 @@ def response(request): requestData = json.loads(request.body) pokemonRequestData = list(requestData.values())[0] print(f"pokemonRequestData: {pokemonRequestData}") + if pokemonRequestData["name"] != ""\ and pokemonRequestData["phone"] != ""\ and pokemonRequestData["pokemon"] != ""\ pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy