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

    From Robert Heller@heller@deepsoft.com to comp.lang.tcl on Thu Mar 7 02:57:21 2024
    From Newsgroup: comp.lang.tcl

    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 <yoda@etoyoc.com>
    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
    heller@deepsoft.com -- Webhosting Services
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From ted@loft.tnolan.com (Ted Nolan@tednolan to comp.lang.tcl on Thu Mar 7 04:09:42 2024
    From Newsgroup: comp.lang.tcl

    In article <hgWdnfghgO6MsHT4nZ2dnZfqnPSdnZ2d@giganews.com>,
    Robert Heller <heller@deepsoft.com> 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 <yoda@etoyoc.com>


    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..
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Robert Heller@heller@deepsoft.com to comp.lang.tcl on Thu Mar 7 05:28:27 2024
    From Newsgroup: comp.lang.tcl

    At 7 Mar 2024 04:09:42 GMT ted@loft.tnolan.com (Ted Nolan <tednolan>) wrote:

    In article <hgWdnfghgO6MsHT4nZ2dnZfqnPSdnZ2d@giganews.com>,
    Robert Heller <heller@deepsoft.com> 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 <yoda@etoyoc.com>


    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
    heller@deepsoft.com -- Webhosting Services
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Rich@rich@example.invalid to comp.lang.tcl on Thu Mar 7 05:34:40 2024
    From Newsgroup: comp.lang.tcl

    Robert Heller <heller@deepsoft.com> 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

    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From ted@loft.tnolan.com (Ted Nolan@tednolan to comp.lang.tcl on Thu Mar 7 05:52:01 2024
    From Newsgroup: comp.lang.tcl

    In article <89CcnVi4AaTmzXT4nZ2dnZfqnPqdnZ2d@giganews.com>,
    Robert Heller <heller@deepsoft.com> wrote:
    At 7 Mar 2024 04:09:42 GMT ted@loft.tnolan.com (Ted Nolan <tednolan>) wrote:


    In article <hgWdnfghgO6MsHT4nZ2dnZfqnPSdnZ2d@giganews.com>,
    Robert Heller <heller@deepsoft.com> 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 <yoda@etoyoc.com>


    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..
    --- Synchronet 3.20a-Linux NewsLink 1.114