HTTP & tcl

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • alf

    #1

    HTTP & tcl

    Hi

    I would like to convert the wctpXml-1.3.py program to Tcl (line by
    line).
    See http://sourceforge.net/project/showf...group_id=29217
    This program sends pages using WCTP. I know nothing about Python or
    XML but this program is small and seems straightforward and I am sure
    that I will be able to figure it out - with a little help ;-)
    Currently I am stuck in not being able to identify the Tcl equivalent
    of Python's "putrequest ", as in:
    h = httplib.HTTP("w ctp.skytel.com" ,80)
    h.putrequest("P OST","/wctp")

    Thanks
    alf

  • Fuzzyman

    #2
    Re: HTTP & tcl


    alf wrote:[color=blue]
    > Hi
    >
    > I would like to convert the wctpXml-1.3.py program to Tcl (line by
    > line).
    > See http://sourceforge.net/project/showf...group_id=29217
    > This program sends pages using WCTP. I know nothing about Python or
    > XML but this program is small and seems straightforward and I am sure
    > that I will be able to figure it out - with a little help ;-)
    > Currently I am stuck in not being able to identify the Tcl equivalent
    > of Python's "putrequest ", as in:
    > h = httplib.HTTP("w ctp.skytel.com" ,80)
    > h.putrequest("P OST","/wctp")
    >[/color]

    You'll get more help on Tcl syntax in a Tcl group. :-)

    Of the HTTP object, the Python documentation says :

    The HTTP class is retained only for backward compatibility with 1.5.2.
    It should not be used in new code. Refer to the online docstrings for
    usage.

    (Meaning that you will find more help on the use of that module in the
    source code - which can also be accessed through Python's pydoc
    feature).


    I assume it does what the newer ``HTTPConnectio n`` class does. The
    putrequest method does the following :

    putrequest( request, selector[, skip_host[, skip_accept_enc oding]])

    This should be the first call after the connection to the server has
    been made. It sends a line to the server consisting of the request
    string, the selector string, and the HTTP version (HTTP/1.1). To
    disable automatic sending of Host: or Accept-Encoding: headers (for
    example to accept additional content encodings), specify skip_host or
    skip_accept_enc oding with non-False values. Changed in version 2.4:
    skip_accept_enc oding argument added.

    In other words - you're creating an HTTP connection and request. You'll
    need to find an 'equivalent' library for Tcl and convert the request
    using hte semantics of whatever library you choose.


    All the best,

    Fuzzyman
    http://www.voidspace.org.uk/python/index.shtml
    [color=blue]
    > Thanks
    > alf[/color]

    Comment

    • Cameron Laird

      #3
      Re: HTTP & tcl

      In article <1140079405.290 586.298270@g44g 2000cwa.googleg roups.com>,
      Fuzzyman <fuzzyman@gmail .com> wrote:[color=blue]
      >
      >alf wrote:[color=green]
      >> Hi
      >>
      >> I would like to convert the wctpXml-1.3.py program to Tcl (line by
      >> line).
      >> See http://sourceforge.net/project/showf...group_id=29217
      >> This program sends pages using WCTP. I know nothing about Python or
      >> XML but this program is small and seems straightforward and I am sure
      >> that I will be able to figure it out - with a little help ;-)
      >> Currently I am stuck in not being able to identify the Tcl equivalent
      >> of Python's "putrequest ", as in:
      >> h = httplib.HTTP("w ctp.skytel.com" ,80)
      >> h.putrequest("P OST","/wctp")
      >>[/color]
      >
      >You'll get more help on Tcl syntax in a Tcl group. :-)
      >
      >Of the HTTP object, the Python documentation says :[/color]

      Comment

      • alf

        #4
        Re: HTTP &amp; tcl

        Cameron Laird wrote:[color=blue]
        > In article <1140079405.290 586.298270@g44g 2000cwa.googleg roups.com>,
        > Fuzzyman <fuzzyman@gmail .com> wrote:[color=green]
        > >
        > >alf wrote:[color=darkred]
        > >> Hi
        > >>
        > >> I would like to convert the wctpXml-1.3.py program to Tcl (line by
        > >> line).
        > >> See http://sourceforge.net/project/showf...group_id=29217
        > >> This program sends pages using WCTP. I know nothing about Python or
        > >> XML but this program is small and seems straightforward and I am sure
        > >> that I will be able to figure it out - with a little help ;-)
        > >> Currently I am stuck in not being able to identify the Tcl equivalent
        > >> of Python's "putrequest ", as in:
        > >> h = httplib.HTTP("w ctp.skytel.com" ,80)
        > >> h.putrequest("P OST","/wctp")
        > >>[/color]
        > >
        > >You'll get more help on Tcl syntax in a Tcl group. :-)
        > >
        > >Of the HTTP object, the Python documentation says :[/color]
        > .
        > .
        > .[color=green]
        > >In other words - you're creating an HTTP connection and request. You'll
        > >need to find an 'equivalent' library for Tcl and convert the request
        > >using hte semantics of whatever library you choose.[/color]
        > .
        > .
        > .
        > If you don't immediately see what you're after in <URL:
        > http://wiki.tcl.tk/http >, post in comp.lang.tcl, and
        > we'll straighten this out.[/color]

        Hi

        I actually did post in comp.lang.tcl. Please search for "wctp" -- the
        3 results are all mine. Apparently, I am the only person interested in
        implementing it in Tcl.
        As always, I appreciate your good will and help.

        alf.

        Comment

        • Cameron Laird

          #5
          Re: HTTP &amp; tcl

          In article <1140219732.545 586.40890@g14g2 000cwa.googlegr oups.com>,
          alf <amnon.friling@ citicorp.com> wrote:

          Comment

          Working...