From: Zbigniew Diaczyszyn on
I am working with ActiveState Tcl version 8.5.7 and when I try to access
the Amazon S3-Server (REST-architecture) I get the message:

http::code: HTTP/1.1 505 HTTP Version Not Supported

The manual lets assume that the package http has HTTP1.1 implemented:

"http - Client-side implementation of the HTTP/1.1 protocol"

but looking into the lib I see only a package for HTTP/1.0:

/opt/ActiveTcl-8.5/lib/tcl8.5/http1.0

Looking in "http.tcl" for the Procedure "geturl" I find the line:

puts $s "$how $srvurl HTTP/1.0"

So I don't know. Unfortunately there is no possibility to get an echo of
what http::geturl does.

The request is done by the following call:

set response [http::geturl "$url/$key" \
-method "POST $url/$key$filename" \
-type "multipart/form-data; boundary=$boundary" \
-query $query]
From: Donal K. Fellows on
On 18 Feb, 16:02, Zbigniew Diaczyszyn <z....(a)gmx.de> wrote:
> I am working with ActiveState Tcl version 8.5.7 and when I try to access
> the Amazon S3-Server (REST-architecture) I get the message:
[...]
> The manual lets assume that the package http has HTTP1.1 implemented:
[...]
> but looking into the lib I see only a package for HTTP/1.0:
>         /opt/ActiveTcl-8.5/lib/tcl8.5/http1.0

You're confused. That's for version 1 of the http *package*, which is
kept around for old scripts. Version 2 should also be present in 8.5.*
(if not, your installation is broken) and that has some support for
HTTP/1.1; it's much better in 8.6 but that's still beta.

Donal.
From: Donald G Porter on
Donal K. Fellows wrote:
> On 18 Feb, 16:02, Zbigniew Diaczyszyn <z....(a)gmx.de> wrote:
>> I am working with ActiveState Tcl version 8.5.7 and when I try to access
>> the Amazon S3-Server (REST-architecture) I get the message:
> [...]
>> The manual lets assume that the package http has HTTP1.1 implemented:
> [...]
>> but looking into the lib I see only a package for HTTP/1.0:
>> /opt/ActiveTcl-8.5/lib/tcl8.5/http1.0
>
> You're confused. That's for version 1 of the http *package*, which is
> kept around for old scripts. Version 2 should also be present in 8.5.*
> (if not, your installation is broken) and that has some support for
> HTTP/1.1; it's much better in 8.6 but that's still beta.

More precisely, releases http 2.7.* have some HTTP/1.1 support and
releases http 2.8.* are better. http 2.8.* requires Tcl 8.6.

DGP
From: Zbigniew Diaczyszyn on
Donald G Porter schrieb:

> That's for version 1 of the http *package*, which is
> kept around for old scripts. Version 2 should also be present in 8.5.*
> (if not, your installation is broken)

I have downloaded the actual version 8.5.8.1 and the lib contains:

/opt/ActiveTcl-8.5/lib/tcl8.5/
|-- encoding
|-- http1.0
|-- msgs
|-- opt0.4
|-- tbcload1.7
|-- thread2.6.5
|-- trofs0.4.4
`-- tzdata

Which is your path for the version 2?

But I found a way to check if the actual implemented http package is
announcing itself to a server with HTTP/1.0 or HTTP/1.1:

There is a Http request command named TRACE which returns the client's
request. I tried it with my own server which is running apache:

%set sock [::http::geturl http://zdia.homelinux.org -method TRACE]
::http::2
% puts [::http::data $sock]
TRACE / HTTP/1.1
Accept: */*
Connection: close
Host: zdia.homelinux.org
User-Agent: Tcl http client package 2.7.5

So this issue is solved and I can go on to try a communication with the
amazon server:

%set sock [::http::geturl http://s3.amazonaws.com -method TRACE]
::http::8
% puts [::http::code $sock]
HTTP/1.1 405 Method Not Allowed

>:-(

From: Jeff Hobbs on
On Feb 20, 10:05 am, Zbigniew Diaczyszyn <z....(a)gmx.de> wrote:
> Donald G Porter schrieb:
>  > That's for version 1 of the http *package*, which is
>  > kept around for old scripts. Version 2 should also be present in 8.5..*
>  > (if not, your installation is broken)
>
> I have downloaded the actual version 8.5.8.1 and the lib contains:
>
> /opt/ActiveTcl-8.5/lib/tcl8.5/
> |-- encoding
> |-- http1.0
> |-- msgs
> |-- opt0.4
> |-- tbcload1.7
> |-- thread2.6.5
> |-- trofs0.4.4
> `-- tzdata
>
> Which is your path for the version 2?

With the different ways that Tcl modules are packaged, looking in lib/
isn't straightforward anymore. The easiest thing to do is open up a
console (or tkcon) and say 'package require http' and see what version
it gives. tkcon also has an Interp -> Manage Packages to give you
more info.

The newer http package happens to be packaged as a module in AT 8.5,
and you will find it at
C:\Tcl\lib\tcl8\8.4\http-2.7.5.tm

Jeff