HTTP & tcl

A

alf

Hi

I would like to convert the wctpXml-1.3.py program to Tcl (line by
line).
See http://sourceforge.net/project/showfiles.php?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("wctp.skytel.com",80)
h.putrequest("POST","/wctp")

Thanks
alf
 
F

Fuzzyman

alf said:
Hi

I would like to convert the wctpXml-1.3.py program to Tcl (line by
line).
See http://sourceforge.net/project/showfiles.php?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("wctp.skytel.com",80)
h.putrequest("POST","/wctp")

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 ``HTTPConnection`` class does. The
putrequest method does the following :

putrequest( request, selector[, skip_host[, skip_accept_encoding]])

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_encoding with non-False values. Changed in version 2.4:
skip_accept_encoding 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
 
C

Cameron Laird

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

Of the HTTP object, the Python documentation says : .
.
.
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.
.
.
.
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.
 
A

alf

Cameron said:
.
.
.
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.

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,285
Messages
2,571,416
Members
48,107
Latest member
AmeliaAmad

Latest Threads

Top