• Don't understand the tcllib/httpd docs...

    From Robert Heller@21:1/5 to All on Thu Mar 7 02:57:21 2024
    I am trying to create a *very simple* http server using the TclOO and
    coroutine based web server that is part of the tcllib package. How do I get the POST data? The example code and the man pages are not helpful.

    This is the package with this copyright notice at the bottom of the man page:

    Copyright (c) 2018 Sean Woods <[email protected]>


    Is Sean Woods listening on comp.lang.tcl? I need some help. I am trying to replace the *broken* python code here (it is python2, which is not supported
    on my Rasberian 12 (bookworm) system):

    https://github.com/BlocklyDuino/BlocklyDuino/blob/master/arduino_web_server.py


    --
    Robert Heller -- Cell: 413-658-7953 GV: 978-633-5364
    Deepwoods Software -- Custom Software Services
    http://www.deepsoft.com/ -- Linux Administration Services
    [email protected] -- Webhosting Services

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ted Nolan @21:1/5 to [email protected] on Thu Mar 7 04:09:42 2024
    In article <[email protected]>,
    Robert Heller <[email protected]> wrote:
    I am trying to create a *very simple* http server using the TclOO and >coroutine based web server that is part of the tcllib package. How do I get >the POST data? The example code and the man pages are not helpful.

    This is the package with this copyright notice at the bottom of the man page:

    Copyright (c) 2018 Sean Woods <[email protected]>


    Is Sean Woods listening on comp.lang.tcl? I need some help. I am trying to >replace the *broken* python code here (it is python2, which is not supported >on my Rasberian 12 (bookworm) system):

    https://github.com/BlocklyDuino/BlocklyDuino/blob/master/arduino_web_server.py


    I remember looking at that as well, and abandoning it because I really understand neither TclOO nor coroutines, and looking at the page wasn't helping. For one project, I found an embedded http server on wiki.tcl.tk,
    but as I recall it doesn't do POST.

    However, the Welch tclhttpd is still available:

    https://wiki.tcl-lang.org/page/TclHttpd

    although I'm guessing that's too heavyweight for your use case.
    --
    columbiaclosings.com
    What's not in Columbia anymore..

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rich@21:1/5 to Robert Heller on Thu Mar 7 05:34:40 2024
    Robert Heller <[email protected]> wrote:
    I am trying to create a *very simple* http server using the TclOO and coroutine based web server that is part of the tcllib package. How
    do I get the POST data? The example code and the man pages are not
    helpful.

    The man page example does not work (or at least the one in my version
    of tcllib is broken and does not work).

    And the docs are scatterd, broken, and disconnected.

    After much "digging", I discovered somewhere (I forget where now) that
    there was a "my FormData" available. So try, from within the method
    that is attached to the url where you submit the post data, and see if
    you have a [my FormData] available. If you do, you get a dict back
    from my FormData with your form keys and values.

    Bits and pieces of this presentation were helpful (and, IIRC, parts of
    it no longer work/apply given changes since the presentation) in
    getting a most basic setup barely working:

    https://www.tcl.tk/community/tcl2018/assets/talk148/Paper.pdf

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Robert Heller@21:1/5 to [email protected] on Thu Mar 7 05:28:27 2024
    At 7 Mar 2024 04:09:42 GMT [email protected] (Ted Nolan <tednolan>) wrote:


    In article <[email protected]>,
    Robert Heller <[email protected]> wrote:
    I am trying to create a *very simple* http server using the TclOO and >coroutine based web server that is part of the tcllib package. How do I get >the POST data? The example code and the man pages are not helpful.

    This is the package with this copyright notice at the bottom of the man page:

    Copyright (c) 2018 Sean Woods <[email protected]>


    Is Sean Woods listening on comp.lang.tcl? I need some help. I am trying to
    replace the *broken* python code here (it is python2, which is not supported >on my Rasberian 12 (bookworm) system):

    https://github.com/BlocklyDuino/BlocklyDuino/blob/master/arduino_web_server.py


    I remember looking at that as well, and abandoning it because I really understand neither TclOO nor coroutines, and looking at the page wasn't helping. For one project, I found an embedded http server on wiki.tcl.tk, but as I recall it doesn't do POST.

    However, the Welch tclhttpd is still available:

    https://wiki.tcl-lang.org/page/TclHttpd

    although I'm guessing that's too heavyweight for your use case.

    I did eventually figure it out.

    --
    Robert Heller -- Cell: 413-658-7953 GV: 978-633-5364
    Deepwoods Software -- Custom Software Services
    http://www.deepsoft.com/ -- Linux Administration Services
    [email protected] -- Webhosting Services

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ted Nolan @21:1/5 to [email protected] on Thu Mar 7 05:52:01 2024
    In article <[email protected]>,
    Robert Heller <[email protected]> wrote:
    At 7 Mar 2024 04:09:42 GMT [email protected] (Ted Nolan <tednolan>) wrote:


    In article <[email protected]>,
    Robert Heller <[email protected]> wrote:
    I am trying to create a *very simple* http server using the TclOO and
    coroutine based web server that is part of the tcllib package. How do I get
    the POST data? The example code and the man pages are not helpful.

    This is the package with this copyright notice at the bottom of the man page:

    Copyright (c) 2018 Sean Woods <[email protected]>


    Is Sean Woods listening on comp.lang.tcl? I need some help. I am
    trying to
    replace the *broken* python code here (it is python2, which is not supported
    on my Rasberian 12 (bookworm) system):

    https://github.com/BlocklyDuino/BlocklyDuino/blob/master/arduino_web_server.py


    I remember looking at that as well, and abandoning it because I really
    understand neither TclOO nor coroutines, and looking at the page wasn't
    helping. For one project, I found an embedded http server on wiki.tcl.tk, >> but as I recall it doesn't do POST.

    However, the Welch tclhttpd is still available:

    https://wiki.tcl-lang.org/page/TclHttpd

    although I'm guessing that's too heavyweight for your use case.

    I did eventually figure it out.


    Great!
    --
    columbiaclosings.com
    What's not in Columbia anymore..

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)