gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet-scheme] 26/49: examples/web.scm: Parse the answer to the DHT ins


From: gnunet
Subject: [gnunet-scheme] 26/49: examples/web.scm: Parse the answer to the DHT insertion form.
Date: Sat, 25 Dec 2021 23:00:03 +0100

This is an automated email from the git hooks/post-receive script.

maxime-devos pushed a commit to branch master
in repository gnunet-scheme.

commit 4487ea15a6d23cb8f321359ed0bb6fad3bdb3422
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Sun Sep 26 22:02:09 2021 +0200

    examples/web.scm: Parse the answer to the DHT insertion form.
    
    * examples/web.scm
      (put-form)[action]: Correct target page.
      (url-handler): Move the pk to ...
      (url-handler)[put-dht]: ... here, and pk the parsed body instead.
---
 examples/web.scm | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/examples/web.scm b/examples/web.scm
index 94af733..08693e0 100644
--- a/examples/web.scm
+++ b/examples/web.scm
@@ -21,6 +21,7 @@
             (web server)
             (web uri)
             (web request)
+            (web form)
             (srfi srfi-11)
             (ice-9 match)
             (sxml simple))
@@ -68,7 +69,7 @@
 ;; TODO: make the form work, defaults, ...
 (define put-form
   `(form
-    (@ (action "/put") (method "post"))
+    (@ (action "/put-dht") (method "post"))
     (ul ,@(common-get/put-form-parts "put-")
        (li (label (@ (for "put-data-encoding")) "Encoding of data: ")
            ,(data-encoding-input "data-encoding" "put-data-encoding"))
@@ -85,7 +86,6 @@
        (dd ,(number->string (nse:estimate:standard-deviation estimate)))))
 
 (define (url-handler server request body)
-  (pk 'r request body)
   (match (uri-path (request-uri request))
     ("/" (respond/html
          `(div (p "A few links")
@@ -99,7 +99,9 @@
            (estimate->html current-estimate)
            '(p "No etimate yet")))))
     ("/search-dht" (respond/html search-form))
-    ("/put-dht" (respond/html put-form))
+    ("/put-dht" ; TODO check method and Content-Type
+     (pk 'parameters (urlencoded->alist body))
+     (respond/html put-form))
     (_ (respond/html '(p "not found"))))) ; TODO 404
 
 (define (start config)

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]