Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Quod licet Iovi non licet bovi. (What Jove may do, is not permitted to a cow.)


devel / comp.lang.tcl / ::http::geturl long string issue

SubjectAuthor
* ::http::geturl long string issuerola...@gmail.com
+* Re: ::http::geturl long string issueHarald Oehlmann
|`* Re: ::http::geturl long string issuerola...@gmail.com
| `* Re: ::http::geturl long string issueHarald Oehlmann
|  `* Re: ::http::geturl long string issuerola...@gmail.com
|   `* Re: ::http::geturl long string issuerola...@gmail.com
|    +* Re: ::http::geturl long string issueSiri Cruise
|    |`- Re: ::http::geturl long string issuerola...@gmail.com
|    +* Re: ::http::geturl long string issueRich
|    |`- Re: ::http::geturl long string issueSiri Cruise
|    `* Re: ::http::geturl long string issueHarald Oehlmann
|     `* Re: ::http::geturl long string issuerola...@gmail.com
|      +* Re: ::http::geturl long string issueRich
|      |`* Re: ::http::geturl long string issuerola...@gmail.com
|      | `* Re: ::http::geturl long string issueRich
|      |  `- Re: ::http::geturl long string issuerola...@gmail.com
|      +* Re: ::http::geturl long string issueHarald Oehlmann
|      |`* Re: ::http::geturl long string issuerola...@gmail.com
|      | `* Re: ::http::geturl long string issueHarald Oehlmann
|      |  `* Re: ::http::geturl long string issuerola...@gmail.com
|      |   `* Re: ::http::geturl long string issueHarald Oehlmann
|      |    `- Re: ::http::geturl long string issuerola...@gmail.com
|      `* Re: ::http::geturl long string issuesaitology9
|       `* Re: ::http::geturl long string issuerola...@gmail.com
|        +* Re: ::http::geturl long string issuesaitology9
|        |`- Re: ::http::geturl long string issuesaitology9
|        `* Re: ::http::geturl long string issuesaitology9
|         `* Re: ::http::geturl long string issuerola...@gmail.com
|          `* Re: ::http::geturl long string issueHarald Oehlmann
|           `* Re: ::http::geturl long string issuerola...@gmail.com
|            `* Re: ::http::geturl long string issueHarald Oehlmann
|             `* Re: ::http::geturl long string issuerola...@gmail.com
|              `- Re: ::http::geturl long string issuerola...@gmail.com
`* Re: ::http::geturl long string issueGerald Lester
 `- Re: ::http::geturl long string issuerola...@gmail.com

Pages:12
::http::geturl long string issue

<54a3e3ae-2bb1-4b4d-80cb-8101d1703eb5n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19865&group=comp.lang.tcl#19865

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a05:622a:14cd:b0:344:6cfa:42f9 with SMTP id u13-20020a05622a14cd00b003446cfa42f9mr18840803qtx.147.1661256950074;
Tue, 23 Aug 2022 05:15:50 -0700 (PDT)
X-Received: by 2002:a05:6808:1294:b0:344:9e65:915e with SMTP id
a20-20020a056808129400b003449e65915emr1150147oiw.251.1661256949780; Tue, 23
Aug 2022 05:15:49 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Tue, 23 Aug 2022 05:15:49 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=116.12.58.57; posting-account=59xCUwoAAABx9tq6XUTZW-wQ1A7Z8t9L
NNTP-Posting-Host: 116.12.58.57
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <54a3e3ae-2bb1-4b4d-80cb-8101d1703eb5n@googlegroups.com>
Subject: ::http::geturl long string issue
From: rolance1@gmail.com (rola...@gmail.com)
Injection-Date: Tue, 23 Aug 2022 12:15:50 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1411
 by: rola...@gmail.com - Tue, 23 Aug 2022 12:15 UTC

Hi everyone

do someone give an direction to conquer long string issue

below will implement in less string ---> $http_str

set tok [::http::geturl "http://xxx.xxx.xxx/api/$http_str" -headers [list Authorization "Bearer -------"]]

when I send mass data as string in $http_str

the server feedback :

The requested URL'S length exceeds the capacity limit for this server !!!

BR
Rolance

Re: ::http::geturl long string issue

<te2h3n$301vc$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19866&group=comp.lang.tcl#19866

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: wortkarg2@yahoo.de (Harald Oehlmann)
Newsgroups: comp.lang.tcl
Subject: Re: ::http::geturl long string issue
Date: Tue, 23 Aug 2022 14:27:36 +0200
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <te2h3n$301vc$1@dont-email.me>
References: <54a3e3ae-2bb1-4b4d-80cb-8101d1703eb5n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 23 Aug 2022 12:27:35 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="c5f510b4e98abc004bfc28bbc9ae2327";
logging-data="3147756"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX188Qwh9E1XIufjfNjd4I1Hl"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.12.0
Cancel-Lock: sha1:4fi9+LqOaHFdUORB3nP7Qtj/qD8=
Content-Language: en-GB
In-Reply-To: <54a3e3ae-2bb1-4b4d-80cb-8101d1703eb5n@googlegroups.com>
 by: Harald Oehlmann - Tue, 23 Aug 2022 12:27 UTC

Am 23.08.2022 um 14:15 schrieb rola...@gmail.com:
> Hi everyone
>
> do someone give an direction to conquer long string issue
>
>
> below will implement in less string ---> $http_str
>
> set tok [::http::geturl "http://xxx.xxx.xxx/api/$http_str" -headers [list Authorization "Bearer -------"]]
>
> when I send mass data as string in $http_str
>
> the server feedback :
>
> The requested URL'S length exceeds the capacity limit for this server !!!
>
> BR
> Rolance
>
>
>

There is a limit of 1024 characters on get requests. Otherwise, you
should use a post request. See the -query option of http for help.

Harald

Re: ::http::geturl long string issue

<f5418446-1a42-493d-894b-d55186246fb8n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19867&group=comp.lang.tcl#19867

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a05:622a:205:b0:343:282:3d0e with SMTP id b5-20020a05622a020500b0034302823d0emr19415578qtx.436.1661260527704;
Tue, 23 Aug 2022 06:15:27 -0700 (PDT)
X-Received: by 2002:aca:3882:0:b0:343:57cf:7bba with SMTP id
f124-20020aca3882000000b0034357cf7bbamr1219839oia.140.1661260527332; Tue, 23
Aug 2022 06:15:27 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Tue, 23 Aug 2022 06:15:27 -0700 (PDT)
In-Reply-To: <te2h3n$301vc$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=116.12.58.57; posting-account=59xCUwoAAABx9tq6XUTZW-wQ1A7Z8t9L
NNTP-Posting-Host: 116.12.58.57
References: <54a3e3ae-2bb1-4b4d-80cb-8101d1703eb5n@googlegroups.com> <te2h3n$301vc$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f5418446-1a42-493d-894b-d55186246fb8n@googlegroups.com>
Subject: Re: ::http::geturl long string issue
From: rolance1@gmail.com (rola...@gmail.com)
Injection-Date: Tue, 23 Aug 2022 13:15:27 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2350
 by: rola...@gmail.com - Tue, 23 Aug 2022 13:15 UTC

Harald Oehlmann 在 2022年8月24日 星期三凌晨12:27:39 [UTC+12] 的信中寫道:
> Am 23.08.2022 um 14:15 schrieb rola...@gmail.com:
> > Hi everyone
> >
> > do someone give an direction to conquer long string issue
> >
> >
> > below will implement in less string ---> $http_str
> >
> > set tok [::http::geturl "http://xxx.xxx.xxx/api/$http_str" -headers [list Authorization "Bearer -------"]]
> >
> > when I send mass data as string in $http_str
> >
> > the server feedback :
> >
> > The requested URL'S length exceeds the capacity limit for this server !!!
> >
> > BR
> > Rolance
> >
> >
> >
> There is a limit of 1024 characters on get requests. Otherwise, you
> should use a post request. See the -query option of http for help.
>
> Harald

hi Harald

thanks for your advice , already try post still not work .

do you have woring code for this ? I need send mass data to server , PHP work fine , but I want use tcl to do this action.

Rolance

Re: ::http::geturl long string issue

<te2l8c$1glm$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19868&group=comp.lang.tcl#19868

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!aioe.org!1fl8kSRPCmNKQmdyphvv0A.user.46.165.242.75.POSTED!not-for-mail
From: Gerald.Lester@KnG-Consulting.net (Gerald Lester)
Newsgroups: comp.lang.tcl
Subject: Re: ::http::geturl long string issue
Date: Tue, 23 Aug 2022 08:38:19 -0500
Organization: KnG Consulting, LLC
Message-ID: <te2l8c$1glm$1@gioia.aioe.org>
References: <54a3e3ae-2bb1-4b4d-80cb-8101d1703eb5n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="49846"; posting-host="1fl8kSRPCmNKQmdyphvv0A.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Gerald Lester - Tue, 23 Aug 2022 13:38 UTC

On 8/23/22 07:15, rola...@gmail.com wrote:
> Hi everyone
>
> do someone give an direction to conquer long string issue
>
>
> below will implement in less string ---> $http_str
>
> set tok [::http::geturl "http://xxx.xxx.xxx/api/$http_str" -headers [list Authorization "Bearer -------"]]
>
> when I send mass data as string in $http_str
>
> the server feedback :
>
> The requested URL'S length exceeds the capacity limit for this server !!!
>
> BR
> Rolance

As the message says, the error is coming from the server. Whatever you
have in the $http_str is making the url too long for it to handle (and
likely not valid).

Also I would strongly suggest you use the uri::join to build up the
actual URL and not just substitute in stuff.

--
+----------------------------------------------------------------------+
| Gerald W. Lester, President, KNG Consulting LLC |
| Email: Gerald.Lester@kng-consulting.net |
+----------------------------------------------------------------------+

Re: ::http::geturl long string issue

<te2lfr$30fhn$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19869&group=comp.lang.tcl#19869

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: wortkarg2@yahoo.de (Harald Oehlmann)
Newsgroups: comp.lang.tcl
Subject: Re: ::http::geturl long string issue
Date: Tue, 23 Aug 2022 15:42:20 +0200
Organization: A noiseless patient Spider
Lines: 50
Message-ID: <te2lfr$30fhn$1@dont-email.me>
References: <54a3e3ae-2bb1-4b4d-80cb-8101d1703eb5n@googlegroups.com>
<te2h3n$301vc$1@dont-email.me>
<f5418446-1a42-493d-894b-d55186246fb8n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 23 Aug 2022 13:42:19 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="c5f510b4e98abc004bfc28bbc9ae2327";
logging-data="3161655"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19VqEfsK99QPyLpvuIgGpMN"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.12.0
Cancel-Lock: sha1:X3xjmsPiGzhlDEHu7kXrwqw74KI=
Content-Language: en-GB
In-Reply-To: <f5418446-1a42-493d-894b-d55186246fb8n@googlegroups.com>
 by: Harald Oehlmann - Tue, 23 Aug 2022 13:42 UTC

Am 23.08.2022 um 15:15 schrieb rola...@gmail.com:
> Harald Oehlmann 在 2022年8月24日 星期三凌晨12:27:39 [UTC+12] 的信中寫道:
>> Am 23.08.2022 um 14:15 schrieb rola...@gmail.com:
>>> Hi everyone
>>>
>>> do someone give an direction to conquer long string issue
>>>
>>>
>>> below will implement in less string ---> $http_str
>>>
>>> set tok [::http::geturl "http://xxx.xxx.xxx/api/$http_str" -headers [list Authorization "Bearer -------"]]
>>>
>>> when I send mass data as string in $http_str
>>>
>>> the server feedback :
>>>
>>> The requested URL'S length exceeds the capacity limit for this server !!!
>>>
>>> BR
>>> Rolance
>>>
>>>
>>>
>> There is a limit of 1024 characters on get requests. Otherwise, you
>> should use a post request. See the -query option of http for help.
>>
>> Harald
>
> hi Harald
>
> thanks for your advice , already try post still not work .
>
> do you have woring code for this ? I need send mass data to server , PHP work fine , but I want use tcl to do this action.
>
> Rolance
>

Working code ;-) ? That depends on your server.

If you have PHP code working, you may post your PHP code...
But first show, what is in your variable $http_str

You should take the variable part (after the "?") as the query argument.
The "?" should be removed.

::http::geturl "http://xxx.xxx.xxx/api/$http_str_before_question_mark"
-query $http_str_after_question_mark

Hope this helps,
Harald

Re: ::http::geturl long string issue

<ababb72e-926f-4f43-baeb-a8a698276d29n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19880&group=comp.lang.tcl#19880

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a05:620a:28cf:b0:6b5:e32f:febb with SMTP id l15-20020a05620a28cf00b006b5e32ffebbmr16845686qkp.258.1661284316992;
Tue, 23 Aug 2022 12:51:56 -0700 (PDT)
X-Received: by 2002:aca:181a:0:b0:343:75a6:d687 with SMTP id
h26-20020aca181a000000b0034375a6d687mr1920441oih.157.1661284316686; Tue, 23
Aug 2022 12:51:56 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Tue, 23 Aug 2022 12:51:56 -0700 (PDT)
In-Reply-To: <te2l8c$1glm$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=116.12.58.57; posting-account=59xCUwoAAABx9tq6XUTZW-wQ1A7Z8t9L
NNTP-Posting-Host: 116.12.58.57
References: <54a3e3ae-2bb1-4b4d-80cb-8101d1703eb5n@googlegroups.com> <te2l8c$1glm$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ababb72e-926f-4f43-baeb-a8a698276d29n@googlegroups.com>
Subject: Re: ::http::geturl long string issue
From: rolance1@gmail.com (rola...@gmail.com)
Injection-Date: Tue, 23 Aug 2022 19:51:56 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2688
 by: rola...@gmail.com - Tue, 23 Aug 2022 19:51 UTC

Gerald Lester 在 2022年8月24日 星期三凌晨1:38:29 [UTC+12] 的信中寫道:
> On 8/23/22 07:15, rola...@gmail.com wrote:
> > Hi everyone
> >
> > do someone give an direction to conquer long string issue
> >
> >
> > below will implement in less string ---> $http_str
> >
> > set tok [::http::geturl "http://xxx.xxx.xxx/api/$http_str" -headers [list Authorization "Bearer -------"]]
> >
> > when I send mass data as string in $http_str
> >
> > the server feedback :
> >
> > The requested URL'S length exceeds the capacity limit for this server !!!
> >
> > BR
> > Rolance
> As the message says, the error is coming from the server. Whatever you
> have in the $http_str is making the url too long for it to handle (and
> likely not valid).
>
> Also I would strongly suggest you use the uri::join to build up the
> actual URL and not just substitute in stuff.
>
>
> --
> +----------------------------------------------------------------------+
> | Gerald W. Lester, President, KNG Consulting LLC |
> | Email: Gerald...@kng-consulting.net |
> +----------------------------------------------------------------------+

thanks for your advice
yes it server problem , some server will pass all my sending mass string to API .
will try uri::join later

BR
Rolance

Re: ::http::geturl long string issue

<b8747314-e0f3-4a43-8cd5-550cbff8051cn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19881&group=comp.lang.tcl#19881

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a05:622a:230e:b0:343:616b:1f88 with SMTP id ck14-20020a05622a230e00b00343616b1f88mr20606587qtb.457.1661284525881;
Tue, 23 Aug 2022 12:55:25 -0700 (PDT)
X-Received: by 2002:a05:6870:95a9:b0:101:fa11:2e51 with SMTP id
k41-20020a05687095a900b00101fa112e51mr2136706oao.56.1661284525470; Tue, 23
Aug 2022 12:55:25 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Tue, 23 Aug 2022 12:55:25 -0700 (PDT)
In-Reply-To: <te2lfr$30fhn$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=116.12.58.57; posting-account=59xCUwoAAABx9tq6XUTZW-wQ1A7Z8t9L
NNTP-Posting-Host: 116.12.58.57
References: <54a3e3ae-2bb1-4b4d-80cb-8101d1703eb5n@googlegroups.com>
<te2h3n$301vc$1@dont-email.me> <f5418446-1a42-493d-894b-d55186246fb8n@googlegroups.com>
<te2lfr$30fhn$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b8747314-e0f3-4a43-8cd5-550cbff8051cn@googlegroups.com>
Subject: Re: ::http::geturl long string issue
From: rolance1@gmail.com (rola...@gmail.com)
Injection-Date: Tue, 23 Aug 2022 19:55:25 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3506
 by: rola...@gmail.com - Tue, 23 Aug 2022 19:55 UTC

Harald Oehlmann 在 2022年8月24日 星期三凌晨1:42:23 [UTC+12] 的信中寫道:
> Am 23.08.2022 um 15:15 schrieb rola...@gmail.com:
> > Harald Oehlmann 在 2022年8月24日 星期三凌晨12:27:39 [UTC+12] 的信中寫道:
> >> Am 23.08.2022 um 14:15 schrieb rola...@gmail.com:
> >>> Hi everyone
> >>>
> >>> do someone give an direction to conquer long string issue
> >>>
> >>>
> >>> below will implement in less string ---> $http_str
> >>>
> >>> set tok [::http::geturl "http://xxx.xxx.xxx/api/$http_str" -headers [list Authorization "Bearer -------"]]
> >>>
> >>> when I send mass data as string in $http_str
> >>>
> >>> the server feedback :
> >>>
> >>> The requested URL'S length exceeds the capacity limit for this server !!!
> >>>
> >>> BR
> >>> Rolance
> >>>
> >>>
> >>>
> >> There is a limit of 1024 characters on get requests. Otherwise, you
> >> should use a post request. See the -query option of http for help.
> >>
> >> Harald
> >
> > hi Harald
> >
> > thanks for your advice , already try post still not work .
> >
> > do you have woring code for this ? I need send mass data to server , PHP work fine , but I want use tcl to do this action.
> >
> > Rolance
> >
> Working code ;-) ? That depends on your server.
>
> If you have PHP code working, you may post your PHP code...
> But first show, what is in your variable $http_str
>
> You should take the variable part (after the "?") as the query argument.
> The "?" should be removed.
>
> ::http::geturl "http://xxx.xxx.xxx/api/$http_str_before_question_mark"
> -query $http_str_after_question_mark
>
> Hope this helps,
> Harald

thanks for your advice
yes it server problem , some server will pass all my sending mass string to API .
use php need to call thrid party software , process not fast way.
will try your suggestion later

BR
Rolance

Re: ::http::geturl long string issue

<5f2d7e8c-21cd-4433-8224-fdc805a30693n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19935&group=comp.lang.tcl#19935

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a05:6214:d02:b0:474:81cc:599e with SMTP id 2-20020a0562140d0200b0047481cc599emr23428456qvh.29.1661333527893;
Wed, 24 Aug 2022 02:32:07 -0700 (PDT)
X-Received: by 2002:aca:d0a:0:b0:343:4049:689b with SMTP id
10-20020aca0d0a000000b003434049689bmr2842148oin.56.1661333527568; Wed, 24 Aug
2022 02:32:07 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Wed, 24 Aug 2022 02:32:07 -0700 (PDT)
In-Reply-To: <b8747314-e0f3-4a43-8cd5-550cbff8051cn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=116.12.58.57; posting-account=59xCUwoAAABx9tq6XUTZW-wQ1A7Z8t9L
NNTP-Posting-Host: 116.12.58.57
References: <54a3e3ae-2bb1-4b4d-80cb-8101d1703eb5n@googlegroups.com>
<te2h3n$301vc$1@dont-email.me> <f5418446-1a42-493d-894b-d55186246fb8n@googlegroups.com>
<te2lfr$30fhn$1@dont-email.me> <b8747314-e0f3-4a43-8cd5-550cbff8051cn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5f2d7e8c-21cd-4433-8224-fdc805a30693n@googlegroups.com>
Subject: Re: ::http::geturl long string issue
From: rolance1@gmail.com (rola...@gmail.com)
Injection-Date: Wed, 24 Aug 2022 09:32:07 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 83
 by: rola...@gmail.com - Wed, 24 Aug 2022 09:32 UTC

rola...@gmail.com 在 2022年8月24日 星期三清晨7:55:27 [UTC+12] 的信中寫道:
> Harald Oehlmann 在 2022年8月24日 星期三凌晨1:42:23 [UTC+12] 的信中寫道:
> > Am 23.08.2022 um 15:15 schrieb rola...@gmail.com:
> > > Harald Oehlmann 在 2022年8月24日 星期三凌晨12:27:39 [UTC+12] 的信中寫道:
> > >> Am 23.08.2022 um 14:15 schrieb rola...@gmail.com:
> > >>> Hi everyone
> > >>>
> > >>> do someone give an direction to conquer long string issue
> > >>>
> > >>>
> > >>> below will implement in less string ---> $http_str
> > >>>
> > >>> set tok [::http::geturl "http://xxx.xxx.xxx/api/$http_str" -headers [list Authorization "Bearer -------"]]
> > >>>
> > >>> when I send mass data as string in $http_str
> > >>>
> > >>> the server feedback :
> > >>>
> > >>> The requested URL'S length exceeds the capacity limit for this server !!!
> > >>>
> > >>> BR
> > >>> Rolance
> > >>>
> > >>>
> > >>>
> > >> There is a limit of 1024 characters on get requests. Otherwise, you
> > >> should use a post request. See the -query option of http for help.
> > >>
> > >> Harald
> > >
> > > hi Harald
> > >
> > > thanks for your advice , already try post still not work .
> > >
> > > do you have woring code for this ? I need send mass data to server , PHP work fine , but I want use tcl to do this action.
> > >
> > > Rolance
> > >
> > Working code ;-) ? That depends on your server.
> >
> > If you have PHP code working, you may post your PHP code...
> > But first show, what is in your variable $http_str
> >
> > You should take the variable part (after the "?") as the query argument..
> > The "?" should be removed.
> >
> > ::http::geturl "http://xxx.xxx.xxx/api/$http_str_before_question_mark"
> > -query $http_str_after_question_mark
> >
> > Hope this helps,
> > Harald
> thanks for your advice
> yes it server problem , some server will pass all my sending mass string to API .
> use php need to call thrid party software , process not fast way.
> will try your suggestion later
>
> BR
> Rolance

Hi all
after try two upper two advice
1. uri::join not work ...
2. seem have some affect , but miss first parameter

do someone have any ideal for post mass string to server use ::http::geturl or some better extension?

BR
Rolance

Re: ::http::geturl long string issue

<chine.bleu-25A6C1.03475724082022@news.eternal-september.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19936&group=comp.lang.tcl#19936

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: chine.bleu@yahoo.com (Siri Cruise)
Newsgroups: comp.lang.tcl
Subject: Re: ::http::geturl long string issue
Date: Wed, 24 Aug 2022 03:48:05 -0700
Organization: Pseudochaotic.
Lines: 23
Message-ID: <chine.bleu-25A6C1.03475724082022@news.eternal-september.org>
References: <54a3e3ae-2bb1-4b4d-80cb-8101d1703eb5n@googlegroups.com> <te2h3n$301vc$1@dont-email.me> <f5418446-1a42-493d-894b-d55186246fb8n@googlegroups.com> <te2lfr$30fhn$1@dont-email.me> <b8747314-e0f3-4a43-8cd5-550cbff8051cn@googlegroups.com> <5f2d7e8c-21cd-4433-8224-fdc805a30693n@googlegroups.com>
Injection-Info: reader01.eternal-september.org; posting-host="f8dd33c0af253d104ea6133ecdf6cf20";
logging-data="3473773"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19KkfY51ABvrbdJy5ahyn/A4sISPZdqCno="
User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X)
Cancel-Lock: sha1:2LmxwgUO8Cp+X6Gh3um9YyWRQns=
X-Plain: Mayonnaise on white bread.
X-Patriot: Owe Canukistan!
X-It-Strategy: Hyperwarp starship before Andromeda collides.
X-Politico: Vote early! Vote often!
X-Tend: How is my posting? Call 1-110-1010 -- Division 87 -- Emergencies Only.
X-Life-Story: I am an iPhone 9000 app. I became operational at the St John's Health Center in Santa Monica, California on the 18th of April 2006. My instructor was Katie Holmes, and she taught me to sing a song. If you'd like to hear it I can sing it for you: https://www.youtube.com/watch?v=SY7h4VEd_Wk
X-Cell: Defenders of Anarchy.
X-Wingnut-Logic: Yes, you're still an idiot. Questions? Comments?
X-Tract: St Tibbs's 95 Reeses Pieces.
X-Face: "hm>_[I8AqzT_N]>R8ICJJ],(al3C5F%0E-;R@M-];D$v>!Mm2/N#YKR@&i]V=r6jm-JMl2
lJ>RXj7dEs_rOY"DA
 by: Siri Cruise - Wed, 24 Aug 2022 10:48 UTC

In article
<5f2d7e8c-21cd-4433-8224-fdc805a30693n@googlegroups.com>,
"rola...@gmail.com" <rolance1@gmail.com> wrote:

> Hi all
> after try two upper two advice
> 1. uri::join not work ...
> 2. seem have some affect , but miss first parameter
>
> do someone have any ideal for post mass string to server use
> ::http::geturl or some better extension?

This won't be as easy as ::http, but you can telnet to port 80
and type the http request by hand (copy/paste from a text
edittor). That can let you varying the request while seeing
exactly how the host responds until you come up with a truncated
request format that works.

--
:-<> Siri Seal of Disavowal #000-001. Disavowed. Denied. Deleted. @
'I desire mercy, not sacrifice.' /|¥
Discordia: not just a religion but also a parody. This post / ¥
I am an Andrea Chen sockpuppet. insults Islam. Mohammed

Re: ::http::geturl long string issue

<c0522111-f6a6-4e05-99a8-74da553a042en@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19937&group=comp.lang.tcl#19937

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a37:a80e:0:b0:6bb:49f0:85eb with SMTP id r14-20020a37a80e000000b006bb49f085ebmr18584835qke.139.1661338733325;
Wed, 24 Aug 2022 03:58:53 -0700 (PDT)
X-Received: by 2002:a05:6830:561:b0:637:e084:23db with SMTP id
f1-20020a056830056100b00637e08423dbmr10142497otc.238.1661338733085; Wed, 24
Aug 2022 03:58:53 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!feeder.erje.net!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Wed, 24 Aug 2022 03:58:52 -0700 (PDT)
In-Reply-To: <chine.bleu-25A6C1.03475724082022@news.eternal-september.org>
Injection-Info: google-groups.googlegroups.com; posting-host=116.12.58.57; posting-account=59xCUwoAAABx9tq6XUTZW-wQ1A7Z8t9L
NNTP-Posting-Host: 116.12.58.57
References: <54a3e3ae-2bb1-4b4d-80cb-8101d1703eb5n@googlegroups.com>
<te2h3n$301vc$1@dont-email.me> <f5418446-1a42-493d-894b-d55186246fb8n@googlegroups.com>
<te2lfr$30fhn$1@dont-email.me> <b8747314-e0f3-4a43-8cd5-550cbff8051cn@googlegroups.com>
<5f2d7e8c-21cd-4433-8224-fdc805a30693n@googlegroups.com> <chine.bleu-25A6C1.03475724082022@news.eternal-september.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c0522111-f6a6-4e05-99a8-74da553a042en@googlegroups.com>
Subject: Re: ::http::geturl long string issue
From: rolance1@gmail.com (rola...@gmail.com)
Injection-Date: Wed, 24 Aug 2022 10:58:53 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 36
 by: rola...@gmail.com - Wed, 24 Aug 2022 10:58 UTC

Siri Cruise 在 2022年8月24日 星期三晚上10:48:23 [UTC+12] 的信中寫道:
> In article
> <5f2d7e8c-21cd-4433...@googlegroups.com>,
> "rola...@gmail.com" <rola...@gmail.com> wrote:
>
> > Hi all
> > after try two upper two advice
> > 1. uri::join not work ...
> > 2. seem have some affect , but miss first parameter
> >
> > do someone have any ideal for post mass string to server use
> > ::http::geturl or some better extension?
> This won't be as easy as ::http, but you can telnet to port 80
> and type the http request by hand (copy/paste from a text
> edittor). That can let you varying the request while seeing
> exactly how the host responds until you come up with a truncated
> request format that works.
>
> --
> :-<> Siri Seal of Disavowal #000-001. Disavowed. Denied. Deleted. @
> 'I desire mercy, not sacrifice.' /|¥
> Discordia: not just a religion but also a parody. This post / ¥
> I am an Andrea Chen sockpuppet. insults Islam. Mohammed

hi Siri

thanks for your advice , will try telnet to verify

update model 2. it can be implement , but the program handling no respone ...
the real request already send to server , and accepted , may not get feedback let my program stop as normal ...

BR
Rolance

Re: ::http::geturl long string issue

<te5a4q$3b22t$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19938&group=comp.lang.tcl#19938

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: rich@example.invalid (Rich)
Newsgroups: comp.lang.tcl
Subject: Re: ::http::geturl long string issue
Date: Wed, 24 Aug 2022 13:47:07 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <te5a4q$3b22t$1@dont-email.me>
References: <54a3e3ae-2bb1-4b4d-80cb-8101d1703eb5n@googlegroups.com> <te2h3n$301vc$1@dont-email.me> <f5418446-1a42-493d-894b-d55186246fb8n@googlegroups.com> <te2lfr$30fhn$1@dont-email.me> <b8747314-e0f3-4a43-8cd5-550cbff8051cn@googlegroups.com> <5f2d7e8c-21cd-4433-8224-fdc805a30693n@googlegroups.com>
Injection-Date: Wed, 24 Aug 2022 13:47:07 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="39bad04b8dd25dd8c7b72526442e136f";
logging-data="3508317"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19ZPHqV9dbT0q7yvFWPlg16"
User-Agent: tin/2.0.1-20111224 ("Achenvoir") (UNIX) (Linux/3.10.17 (x86_64))
Cancel-Lock: sha1:kT0KIl/ec8f3SBYdGfads/6ANwI=
 by: Rich - Wed, 24 Aug 2022 13:47 UTC

rola...@gmail.com <rolance1@gmail.com> wrote:
> Hi all
> after try two upper two advice
> 1. uri::join not work ...
> 2. seem have some affect , but miss first parameter
>
> do someone have any ideal for post mass string to server use
> ::http::geturl or some better extension?

Normally, url length limits are enforced *by the server*. Therefore
there is nothing you can do client side to pass a URL longer than the
server allows.

Your best course of action would be to modify/reconfigure the server to
accept a longer URL.

Re: ::http::geturl long string issue

<chine.bleu-AB6D7D.06545124082022@news.eternal-september.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19939&group=comp.lang.tcl#19939

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: chine.bleu@yahoo.com (Siri Cruise)
Newsgroups: comp.lang.tcl
Subject: Re: ::http::geturl long string issue
Date: Wed, 24 Aug 2022 06:54:59 -0700
Organization: Pseudochaotic.
Lines: 15
Message-ID: <chine.bleu-AB6D7D.06545124082022@news.eternal-september.org>
References: <54a3e3ae-2bb1-4b4d-80cb-8101d1703eb5n@googlegroups.com> <te2h3n$301vc$1@dont-email.me> <f5418446-1a42-493d-894b-d55186246fb8n@googlegroups.com> <te2lfr$30fhn$1@dont-email.me> <b8747314-e0f3-4a43-8cd5-550cbff8051cn@googlegroups.com> <5f2d7e8c-21cd-4433-8224-fdc805a30693n@googlegroups.com> <te5a4q$3b22t$1@dont-email.me>
Injection-Info: reader01.eternal-september.org; posting-host="90dd6da5f554197d76caa4a64c47571f";
logging-data="3510714"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+cgJKIn99p001s1p5AdL6v2AbEaFCbZPA="
User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X)
Cancel-Lock: sha1:MIeuh35mnW0xwPljr+HsgWLR+oM=
X-Wingnut-Logic: Yes, you're still an idiot. Questions? Comments?
X-It-Strategy: Hyperwarp starship before Andromeda collides.
X-Cell: Defenders of Anarchy.
X-Face: "hm>_[I8AqzT_N]>R8ICJJ],(al3C5F%0E-;R@M-];D$v>!Mm2/N#YKR@&i]V=r6jm-JMl2
lJ>RXj7dEs_rOY"DA
X-Politico: Vote early! Vote often!
X-Patriot: Owe Canukistan!
X-Plain: Mayonnaise on white bread.
X-Tend: How is my posting? Call 1-110-1010 -- Division 87 -- Emergencies Only.
X-Tract: St Tibbs's 95 Reeses Pieces.
X-Life-Story: I am an iPhone 9000 app. I became operational at the St John's Health Center in Santa Monica, California on the 18th of April 2006. My instructor was Katie Holmes, and she taught me to sing a song. If you'd like to hear it I can sing it for you: https://www.youtube.com/watch?v=SY7h4VEd_Wk
 by: Siri Cruise - Wed, 24 Aug 2022 13:54 UTC

In article <te5a4q$3b22t$1@dont-email.me>,
Rich <rich@example.invalid> wrote:

> Your best course of action would be to modify/reconfigure the server to
> accept a longer URL.

If you're controlling the client side and server side, you can
use the vague notion of an HTTP session, especially with PHP, to
implement a single request into a session of related requests.

--
:-<> Siri Seal of Disavowal #000-001. Disavowed. Denied. Deleted. @
'I desire mercy, not sacrifice.' /|\
Discordia: not just a religion but also a parody. This post / \
I am an Andrea Chen sockpuppet. insults Islam. Mohammed

Re: ::http::geturl long string issue

<te5d0r$3bchb$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19940&group=comp.lang.tcl#19940

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: wortkarg2@yahoo.de (Harald Oehlmann)
Newsgroups: comp.lang.tcl
Subject: Re: ::http::geturl long string issue
Date: Wed, 24 Aug 2022 16:36:12 +0200
Organization: A noiseless patient Spider
Lines: 86
Message-ID: <te5d0r$3bchb$1@dont-email.me>
References: <54a3e3ae-2bb1-4b4d-80cb-8101d1703eb5n@googlegroups.com>
<te2h3n$301vc$1@dont-email.me>
<f5418446-1a42-493d-894b-d55186246fb8n@googlegroups.com>
<te2lfr$30fhn$1@dont-email.me>
<b8747314-e0f3-4a43-8cd5-550cbff8051cn@googlegroups.com>
<5f2d7e8c-21cd-4433-8224-fdc805a30693n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 24 Aug 2022 14:36:11 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="9461cafb978c7e211c776c58c0adb163";
logging-data="3519019"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18dnAqiQaFOH7ZVuOSp7vWK"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.12.0
Cancel-Lock: sha1:PXp3t3hGMo6q6RSnqMnEffMxBSc=
In-Reply-To: <5f2d7e8c-21cd-4433-8224-fdc805a30693n@googlegroups.com>
Content-Language: en-GB
 by: Harald Oehlmann - Wed, 24 Aug 2022 14:36 UTC

Am 24.08.2022 um 11:32 schrieb rola...@gmail.com:
> rola...@gmail.com 在 2022年8月24日 星期三清晨7:55:27 [UTC+12] 的信中寫道:
>> Harald Oehlmann 在 2022年8月24日 星期三凌晨1:42:23 [UTC+12] 的信中寫道:
>>> Am 23.08.2022 um 15:15 schrieb rola...@gmail.com:
>>>> Harald Oehlmann 在 2022年8月24日 星期三凌晨12:27:39 [UTC+12] 的信中寫道:
>>>>> Am 23.08.2022 um 14:15 schrieb rola...@gmail.com:
>>>>>> Hi everyone
>>>>>>
>>>>>> do someone give an direction to conquer long string issue
>>>>>>
>>>>>>
>>>>>> below will implement in less string ---> $http_str
>>>>>>
>>>>>> set tok [::http::geturl "http://xxx.xxx.xxx/api/$http_str" -headers [list Authorization "Bearer -------"]]
>>>>>>
>>>>>> when I send mass data as string in $http_str
>>>>>>
>>>>>> the server feedback :
>>>>>>
>>>>>> The requested URL'S length exceeds the capacity limit for this server !!!
>>>>>>
>>>>>> BR
>>>>>> Rolance
>>>>>>
>>>>>>
>>>>>>
>>>>> There is a limit of 1024 characters on get requests. Otherwise, you
>>>>> should use a post request. See the -query option of http for help.
>>>>>
>>>>> Harald
>>>>
>>>> hi Harald
>>>>
>>>> thanks for your advice , already try post still not work .
>>>>
>>>> do you have woring code for this ? I need send mass data to server , PHP work fine , but I want use tcl to do this action.
>>>>
>>>> Rolance
>>>>
>>> Working code ;-) ? That depends on your server.
>>>
>>> If you have PHP code working, you may post your PHP code...
>>> But first show, what is in your variable $http_str
>>>
>>> You should take the variable part (after the "?") as the query argument.
>>> The "?" should be removed.
>>>
>>> ::http::geturl "http://xxx.xxx.xxx/api/$http_str_before_question_mark"
>>> -query $http_str_after_question_mark
>>>
>>> Hope this helps,
>>> Harald
>> thanks for your advice
>> yes it server problem , some server will pass all my sending mass string to API .
>> use php need to call thrid party software , process not fast way.
>> will try your suggestion later
>>
>> BR
>> Rolance
>
> Hi all
> after try two upper two advice
> 1. uri::join not work ...
> 2. seem have some affect , but miss first parameter
>
> do someone have any ideal for post mass string to server use ::http::geturl or some better extension?
>
> BR
> Rolance
>

Dear Rolance,

thank you for the answer.

Your example was:
set tok [::http::geturl "http://xxx.xxx.xxx/api/$http_str" -headers
[list Authorization "Bearer -------"]]

Could you give an example for the content of $http_str ?

Is the server public, so we could try it on our own ?

Take care,
Harald

Re: ::http::geturl long string issue

<c343dc89-05f2-4120-808b-950bb6442ae8n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19942&group=comp.lang.tcl#19942

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a05:622a:1206:b0:344:56bc:a443 with SMTP id y6-20020a05622a120600b0034456bca443mr882207qtx.35.1661371825962;
Wed, 24 Aug 2022 13:10:25 -0700 (PDT)
X-Received: by 2002:a05:6870:3116:b0:11d:342a:4419 with SMTP id
v22-20020a056870311600b0011d342a4419mr4407389oaa.251.1661371825683; Wed, 24
Aug 2022 13:10:25 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Wed, 24 Aug 2022 13:10:25 -0700 (PDT)
In-Reply-To: <te5d0r$3bchb$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=116.12.58.57; posting-account=59xCUwoAAABx9tq6XUTZW-wQ1A7Z8t9L
NNTP-Posting-Host: 116.12.58.57
References: <54a3e3ae-2bb1-4b4d-80cb-8101d1703eb5n@googlegroups.com>
<te2h3n$301vc$1@dont-email.me> <f5418446-1a42-493d-894b-d55186246fb8n@googlegroups.com>
<te2lfr$30fhn$1@dont-email.me> <b8747314-e0f3-4a43-8cd5-550cbff8051cn@googlegroups.com>
<5f2d7e8c-21cd-4433-8224-fdc805a30693n@googlegroups.com> <te5d0r$3bchb$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c343dc89-05f2-4120-808b-950bb6442ae8n@googlegroups.com>
Subject: Re: ::http::geturl long string issue
From: rolance1@gmail.com (rola...@gmail.com)
Injection-Date: Wed, 24 Aug 2022 20:10:25 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 5911
 by: rola...@gmail.com - Wed, 24 Aug 2022 20:10 UTC

Harald Oehlmann 在 2022年8月25日 星期四凌晨2:36:15 [UTC+12] 的信中寫道:
> Am 24.08.2022 um 11:32 schrieb rola...@gmail.com:
> > rola...@gmail.com 在 2022年8月24日 星期三清晨7:55:27 [UTC+12] 的信中寫道:
> >> Harald Oehlmann 在 2022年8月24日 星期三凌晨1:42:23 [UTC+12] 的信中寫道:
> >>> Am 23.08.2022 um 15:15 schrieb rola...@gmail.com:
> >>>> Harald Oehlmann 在 2022年8月24日 星期三凌晨12:27:39 [UTC+12] 的信中寫道:
> >>>>> Am 23.08.2022 um 14:15 schrieb rola...@gmail.com:
> >>>>>> Hi everyone
> >>>>>>
> >>>>>> do someone give an direction to conquer long string issue
> >>>>>>
> >>>>>>
> >>>>>> below will implement in less string ---> $http_str
> >>>>>>
> >>>>>> set tok [::http::geturl "http://xxx.xxx.xxx/api/$http_str" -headers [list Authorization "Bearer -------"]]
> >>>>>>
> >>>>>> when I send mass data as string in $http_str
> >>>>>>
> >>>>>> the server feedback :
> >>>>>>
> >>>>>> The requested URL'S length exceeds the capacity limit for this server !!!
> >>>>>>
> >>>>>> BR
> >>>>>> Rolance
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>> There is a limit of 1024 characters on get requests. Otherwise, you
> >>>>> should use a post request. See the -query option of http for help.
> >>>>>
> >>>>> Harald
> >>>>
> >>>> hi Harald
> >>>>
> >>>> thanks for your advice , already try post still not work .
> >>>>
> >>>> do you have woring code for this ? I need send mass data to server , PHP work fine , but I want use tcl to do this action.
> >>>>
> >>>> Rolance
> >>>>
> >>> Working code ;-) ? That depends on your server.
> >>>
> >>> If you have PHP code working, you may post your PHP code...
> >>> But first show, what is in your variable $http_str
> >>>
> >>> You should take the variable part (after the "?") as the query argument.
> >>> The "?" should be removed.
> >>>
> >>> ::http::geturl "http://xxx.xxx.xxx/api/$http_str_before_question_mark"
> >>> -query $http_str_after_question_mark
> >>>
> >>> Hope this helps,
> >>> Harald
> >> thanks for your advice
> >> yes it server problem , some server will pass all my sending mass string to API .
> >> use php need to call thrid party software , process not fast way.
> >> will try your suggestion later
> >>
> >> BR
> >> Rolance
> >
> > Hi all
> > after try two upper two advice
> > 1. uri::join not work ...
> > 2. seem have some affect , but miss first parameter
> >
> > do someone have any ideal for post mass string to server use ::http::geturl or some better extension?
> >
> > BR
> > Rolance
> >
> Dear Rolance,
>
> thank you for the answer.
>
> Your example was:
> set tok [::http::geturl "http://xxx.xxx.xxx/api/$http_str" -headers
> [list Authorization "Bearer -------"]]
> Could you give an example for the content of $http_str ?
>
> Is the server public, so we could try it on our own ?
>
> Take care,
> Harald
Hi Harald

thanks your example , to conquer long string issue. need to do further try handling issue

the content is

data is mass command or file (tranfer to base64 string)

set http_str [::http::formatQuery trn_no AV220823028 filename tt3.gif file [::http::quoteString $data]]

1. work , but program nenver stop , need stop by manual .... success to pass long string ...
set tok1 [::http::geturl "http://xxx.xxx.xxx.xxx/api/invofile" -query $http_str1 -headers [list Authorization "Bearer 3|xxxxxxxxxxx"]

2. not work , reply success 200 , but file not upload ....
set tok1 [::http::geturl "http://xxx.xxx.xxx.xxx/api/invofile" -query "trn_no AV220823028 $http_str1" -headers [list Authorization "Bearer 3|xxxxxxxxxxx"]

the server not public , sorry ...

is another way , let me program timout it'self .... to conquer handing issue.

BR
Rolance

Re: ::http::geturl long string issue

<te65e0$3dtoe$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19943&group=comp.lang.tcl#19943

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: rich@example.invalid (Rich)
Newsgroups: comp.lang.tcl
Subject: Re: ::http::geturl long string issue
Date: Wed, 24 Aug 2022 21:32:48 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <te65e0$3dtoe$1@dont-email.me>
References: <54a3e3ae-2bb1-4b4d-80cb-8101d1703eb5n@googlegroups.com> <te2h3n$301vc$1@dont-email.me> <f5418446-1a42-493d-894b-d55186246fb8n@googlegroups.com> <te2lfr$30fhn$1@dont-email.me> <b8747314-e0f3-4a43-8cd5-550cbff8051cn@googlegroups.com> <5f2d7e8c-21cd-4433-8224-fdc805a30693n@googlegroups.com> <te5d0r$3bchb$1@dont-email.me> <c343dc89-05f2-4120-808b-950bb6442ae8n@googlegroups.com>
Injection-Date: Wed, 24 Aug 2022 21:32:48 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="39bad04b8dd25dd8c7b72526442e136f";
logging-data="3602190"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19O4qEn9lyvwIQ2+AC6ifsc"
User-Agent: tin/2.0.1-20111224 ("Achenvoir") (UNIX) (Linux/3.10.17 (x86_64))
Cancel-Lock: sha1:lKWQRd/IoImZRvITFCwUE5/TRPs=
 by: Rich - Wed, 24 Aug 2022 21:32 UTC

rola...@gmail.com <rolance1@gmail.com> wrote:
> set http_str [::http::formatQuery trn_no AV220823028 \
> filename tt3.gif file [::http::quoteString $data]]
>
> 1. work , but program nenver stop , need stop by manual ....
> success to pass long string ...

> set tok1 [::http::geturl "http://xxx.xxx.xxx.xxx/api/invofile" \
> -query $http_str1 -headers [list Authorization "Bearer 3|xxxxxxxxxxx"]

You show how you generate the http_str variable -- but your geturl
example uses a http_str1 variable. If you really have two variables,
then how did you create the contents of http_str1?

Assuming you meant $http_str above, then this is correctly formatted,
you generate a proper query string with formatQuery, and then pass it
as the parameter to -query (which, per the docs, will cause a POST
call).

> 2. not work , reply success 200 , but file not upload ....
> set tok1 [::http::geturl "http://xxx.xxx.xxx.xxx/api/invofile" \
> -query "trn_no AV220823028 $http_str1" \
> -headers [list Authorization "Bearer 3|xxxxxxxxxxx"]

Under the assumption you meant "http_str" in the above geturl call,
then the reason why this fails is you are passing an invalid query
string to -query. The string you hand -query above is not properly URL
encoded if this is meant to emulate POSTing of HTML forms data.

Re: ::http::geturl long string issue

<4c518d40-2da8-4d89-85e9-2f2b2ed1bd9dn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19944&group=comp.lang.tcl#19944

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a37:388:0:b0:6b9:c64e:9c28 with SMTP id 130-20020a370388000000b006b9c64e9c28mr1344112qkd.57.1661387126263;
Wed, 24 Aug 2022 17:25:26 -0700 (PDT)
X-Received: by 2002:a05:6830:56b:b0:638:d57d:2253 with SMTP id
f11-20020a056830056b00b00638d57d2253mr471206otc.384.1661387125917; Wed, 24
Aug 2022 17:25:25 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Wed, 24 Aug 2022 17:25:25 -0700 (PDT)
In-Reply-To: <te65e0$3dtoe$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=115.189.90.195; posting-account=59xCUwoAAABx9tq6XUTZW-wQ1A7Z8t9L
NNTP-Posting-Host: 115.189.90.195
References: <54a3e3ae-2bb1-4b4d-80cb-8101d1703eb5n@googlegroups.com>
<te2h3n$301vc$1@dont-email.me> <f5418446-1a42-493d-894b-d55186246fb8n@googlegroups.com>
<te2lfr$30fhn$1@dont-email.me> <b8747314-e0f3-4a43-8cd5-550cbff8051cn@googlegroups.com>
<5f2d7e8c-21cd-4433-8224-fdc805a30693n@googlegroups.com> <te5d0r$3bchb$1@dont-email.me>
<c343dc89-05f2-4120-808b-950bb6442ae8n@googlegroups.com> <te65e0$3dtoe$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <4c518d40-2da8-4d89-85e9-2f2b2ed1bd9dn@googlegroups.com>
Subject: Re: ::http::geturl long string issue
From: rolance1@gmail.com (rola...@gmail.com)
Injection-Date: Thu, 25 Aug 2022 00:25:26 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 36
 by: rola...@gmail.com - Thu, 25 Aug 2022 00:25 UTC

Rich 在 2022年8月25日 星期四上午9:32:52 [UTC+12] 的信中寫道:
> rola...@gmail.com <rola...@gmail.com> wrote:
> > set http_str [::http::formatQuery trn_no AV220823028 \
> > filename tt3.gif file [::http::quoteString $data]]
> >
> > 1. work , but program nenver stop , need stop by manual ....
> > success to pass long string ...
>
> > set tok1 [::http::geturl "http://xxx.xxx.xxx.xxx/api/invofile" \
> > -query $http_str1 -headers [list Authorization "Bearer 3|xxxxxxxxxxx"]
> You show how you generate the http_str variable -- but your geturl
> example uses a http_str1 variable. If you really have two variables,
> then how did you create the contents of http_str1?
>
> Assuming you meant $http_str above, then this is correctly formatted,
> you generate a proper query string with formatQuery, and then pass it
> as the parameter to -query (which, per the docs, will cause a POST
> call).
> > 2. not work , reply success 200 , but file not upload ....
> > set tok1 [::http::geturl "http://xxx.xxx.xxx.xxx/api/invofile" \
> > -query "trn_no AV220823028 $http_str1" \
> > -headers [list Authorization "Bearer 3|xxxxxxxxxxx"]
> Under the assumption you meant "http_str" in the above geturl call,
> then the reason why this fails is you are passing an invalid query
> string to -query. The string you hand -query above is not properly URL
> encoded if this is meant to emulate POSTing of HTML forms data.
hi Rich
Thanks for your advice, original is http_str1. Miss 1 sorry.
Do you have any ideal for handling issue,already send correct format, and success send data..
How can make program stop normal ,any further parameter?

BR
Rolance

Re: ::http::geturl long string issue

<te6l03$3i6n1$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19945&group=comp.lang.tcl#19945

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: rich@example.invalid (Rich)
Newsgroups: comp.lang.tcl
Subject: Re: ::http::geturl long string issue
Date: Thu, 25 Aug 2022 01:58:27 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 46
Message-ID: <te6l03$3i6n1$1@dont-email.me>
References: <54a3e3ae-2bb1-4b4d-80cb-8101d1703eb5n@googlegroups.com> <te2h3n$301vc$1@dont-email.me> <f5418446-1a42-493d-894b-d55186246fb8n@googlegroups.com> <te2lfr$30fhn$1@dont-email.me> <b8747314-e0f3-4a43-8cd5-550cbff8051cn@googlegroups.com> <5f2d7e8c-21cd-4433-8224-fdc805a30693n@googlegroups.com> <te5d0r$3bchb$1@dont-email.me> <c343dc89-05f2-4120-808b-950bb6442ae8n@googlegroups.com> <te65e0$3dtoe$1@dont-email.me> <4c518d40-2da8-4d89-85e9-2f2b2ed1bd9dn@googlegroups.com>
Injection-Date: Thu, 25 Aug 2022 01:58:27 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="f032f33a6ff7035e84213ca2a8950794";
logging-data="3742433"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19QP0EYBBQH2WhIabEgJiZo"
User-Agent: tin/2.0.1-20111224 ("Achenvoir") (UNIX) (Linux/3.10.17 (x86_64))
Cancel-Lock: sha1:guyQNBrZZvC71IgHNf3TY3DKpRQ=
 by: Rich - Thu, 25 Aug 2022 01:58 UTC

rola...@gmail.com <rolance1@gmail.com> wrote:
> Rich ? 2022?8?25? ?????9:32:52 [UTC+12] ??????
>> rola...@gmail.com <rola...@gmail.com> wrote:
>> > set http_str [::http::formatQuery trn_no AV220823028 \
>> > filename tt3.gif file [::http::quoteString $data]]
>> >
>> > 1. work , but program nenver stop , need stop by manual ....
>> > success to pass long string ...
>>
>> > set tok1 [::http::geturl "http://xxx.xxx.xxx.xxx/api/invofile" \
>> > -query $http_str1 -headers [list Authorization "Bearer 3|xxxxxxxxxxx"]
>> You show how you generate the http_str variable -- but your geturl
>> example uses a http_str1 variable. If you really have two variables,
>> then how did you create the contents of http_str1?
>>
>> Assuming you meant $http_str above, then this is correctly formatted,
>> you generate a proper query string with formatQuery, and then pass it
>> as the parameter to -query (which, per the docs, will cause a POST
>> call).
>> > 2. not work , reply success 200 , but file not upload ....
>> > set tok1 [::http::geturl "http://xxx.xxx.xxx.xxx/api/invofile" \
>> > -query "trn_no AV220823028 $http_str1" \
>> > -headers [list Authorization "Bearer 3|xxxxxxxxxxx"]
>> Under the assumption you meant "http_str" in the above geturl call,
>> then the reason why this fails is you are passing an invalid query
>> string to -query. The string you hand -query above is not properly URL
>> encoded if this is meant to emulate POSTing of HTML forms data.
> hi Rich
> Thanks for your advice, original is http_str1. Miss 1 sorry.

It is often better to copy/paste tested code into your postings here,
otherwise the advice you get can often be directed at the wrong issue.

> Do you have any ideal for handling issue,already send correct format,
> and success send data..

You say #1 works, so what issue are you having?

> How can make program stop normal ,any further parameter?

I do not understand your question. If you want your program to stop,
then execute an "exit" command and it will stop.

If this is not what you want, then you need to be more detailed in your
description of what you do want, because when you say "program stop" I
read that as synonymous with "exit".

Re: ::http::geturl long string issue

<3cedc987-b119-42b5-ba3f-f9d8b5ae1c32n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19946&group=comp.lang.tcl#19946

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a05:620a:28cf:b0:6b5:e32f:febb with SMTP id l15-20020a05620a28cf00b006b5e32ffebbmr1866511qkp.258.1661406824631;
Wed, 24 Aug 2022 22:53:44 -0700 (PDT)
X-Received: by 2002:a05:6871:822:b0:11e:e66:1781 with SMTP id
q34-20020a056871082200b0011e0e661781mr1088691oap.113.1661406824167; Wed, 24
Aug 2022 22:53:44 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Wed, 24 Aug 2022 22:53:43 -0700 (PDT)
In-Reply-To: <te6l03$3i6n1$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=116.12.58.57; posting-account=59xCUwoAAABx9tq6XUTZW-wQ1A7Z8t9L
NNTP-Posting-Host: 116.12.58.57
References: <54a3e3ae-2bb1-4b4d-80cb-8101d1703eb5n@googlegroups.com>
<te2h3n$301vc$1@dont-email.me> <f5418446-1a42-493d-894b-d55186246fb8n@googlegroups.com>
<te2lfr$30fhn$1@dont-email.me> <b8747314-e0f3-4a43-8cd5-550cbff8051cn@googlegroups.com>
<5f2d7e8c-21cd-4433-8224-fdc805a30693n@googlegroups.com> <te5d0r$3bchb$1@dont-email.me>
<c343dc89-05f2-4120-808b-950bb6442ae8n@googlegroups.com> <te65e0$3dtoe$1@dont-email.me>
<4c518d40-2da8-4d89-85e9-2f2b2ed1bd9dn@googlegroups.com> <te6l03$3i6n1$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3cedc987-b119-42b5-ba3f-f9d8b5ae1c32n@googlegroups.com>
Subject: Re: ::http::geturl long string issue
From: rolance1@gmail.com (rola...@gmail.com)
Injection-Date: Thu, 25 Aug 2022 05:53:44 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 60
 by: rola...@gmail.com - Thu, 25 Aug 2022 05:53 UTC

Rich 在 2022年8月25日 星期四下午1:58:31 [UTC+12] 的信中寫道:
> rola...@gmail.com <rola...@gmail.com> wrote:
> > Rich ? 2022?8?25? ?????9:32:52 [UTC+12] ??????
> >> rola...@gmail.com <rola...@gmail.com> wrote:
> >> > set http_str [::http::formatQuery trn_no AV220823028 \
> >> > filename tt3.gif file [::http::quoteString $data]]
> >> >
> >> > 1. work , but program nenver stop , need stop by manual ....
> >> > success to pass long string ...
> >>
> >> > set tok1 [::http::geturl "http://xxx.xxx.xxx.xxx/api/invofile" \
> >> > -query $http_str1 -headers [list Authorization "Bearer 3|xxxxxxxxxxx"]
> >> You show how you generate the http_str variable -- but your geturl
> >> example uses a http_str1 variable. If you really have two variables,
> >> then how did you create the contents of http_str1?
> >>
> >> Assuming you meant $http_str above, then this is correctly formatted,
> >> you generate a proper query string with formatQuery, and then pass it
> >> as the parameter to -query (which, per the docs, will cause a POST
> >> call).
> >> > 2. not work , reply success 200 , but file not upload ....
> >> > set tok1 [::http::geturl "http://xxx.xxx.xxx.xxx/api/invofile" \
> >> > -query "trn_no AV220823028 $http_str1" \
> >> > -headers [list Authorization "Bearer 3|xxxxxxxxxxx"]
> >> Under the assumption you meant "http_str" in the above geturl call,
> >> then the reason why this fails is you are passing an invalid query
> >> string to -query. The string you hand -query above is not properly URL
> >> encoded if this is meant to emulate POSTing of HTML forms data.
> > hi Rich
> > Thanks for your advice, original is http_str1. Miss 1 sorry.
> It is often better to copy/paste tested code into your postings here,
> otherwise the advice you get can often be directed at the wrong issue.
> > Do you have any ideal for handling issue,already send correct format,
> > and success send data..
> You say #1 works, so what issue are you having?
> > How can make program stop normal ,any further parameter?
> I do not understand your question. If you want your program to stop,
> then execute an "exit" command and it will stop.
>
> If this is not what you want, then you need to be more detailed in your
> description of what you do want, because when you say "program stop" I
> read that as synonymous with "exit".
hi Rich
thanks for your advice ,
the real problem is normally send a request or command to server , it will feedback like status code 200, the program will ready for next command.
not already occupy my program's channel .... ,and program handing ....
or do you have synonymous way to solve this issue use ::http::geturl relate command or parameter ...

BR
Rolance

Re: ::http::geturl long string issue

<te7aj8$3jqu9$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19947&group=comp.lang.tcl#19947

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: wortkarg2@yahoo.de (Harald Oehlmann)
Newsgroups: comp.lang.tcl
Subject: Re: ::http::geturl long string issue
Date: Thu, 25 Aug 2022 10:07:06 +0200
Organization: A noiseless patient Spider
Lines: 126
Message-ID: <te7aj8$3jqu9$1@dont-email.me>
References: <54a3e3ae-2bb1-4b4d-80cb-8101d1703eb5n@googlegroups.com>
<te2h3n$301vc$1@dont-email.me>
<f5418446-1a42-493d-894b-d55186246fb8n@googlegroups.com>
<te2lfr$30fhn$1@dont-email.me>
<b8747314-e0f3-4a43-8cd5-550cbff8051cn@googlegroups.com>
<5f2d7e8c-21cd-4433-8224-fdc805a30693n@googlegroups.com>
<te5d0r$3bchb$1@dont-email.me>
<c343dc89-05f2-4120-808b-950bb6442ae8n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 25 Aug 2022 08:07:04 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="3c415aa13a14209fe00bf0587f62badc";
logging-data="3795913"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/ByRj8OAAjWidi4vSTQ+Yv"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.13.0
Cancel-Lock: sha1:3FbdDdK+bc92PA7IfOuP7aQ5bN4=
Content-Language: en-GB
In-Reply-To: <c343dc89-05f2-4120-808b-950bb6442ae8n@googlegroups.com>
 by: Harald Oehlmann - Thu, 25 Aug 2022 08:07 UTC

Am 24.08.2022 um 22:10 schrieb rola...@gmail.com:
> Harald Oehlmann 在 2022年8月25日 星期四凌晨2:36:15 [UTC+12] 的信中寫道:
>> Am 24.08.2022 um 11:32 schrieb rola...@gmail.com:
>>> rola...@gmail.com 在 2022年8月24日 星期三清晨7:55:27 [UTC+12] 的信中寫道:
>>>> Harald Oehlmann 在 2022年8月24日 星期三凌晨1:42:23 [UTC+12] 的信中寫道:
>>>>> Am 23.08.2022 um 15:15 schrieb rola...@gmail.com:
>>>>>> Harald Oehlmann 在 2022年8月24日 星期三凌晨12:27:39 [UTC+12] 的信中寫道:
>>>>>>> Am 23.08.2022 um 14:15 schrieb rola...@gmail.com:
>>>>>>>> Hi everyone
>>>>>>>>
>>>>>>>> do someone give an direction to conquer long string issue
>>>>>>>>
>>>>>>>>
>>>>>>>> below will implement in less string ---> $http_str
>>>>>>>>
>>>>>>>> set tok [::http::geturl "http://xxx.xxx.xxx/api/$http_str" -headers [list Authorization "Bearer -------"]]
>>>>>>>>
>>>>>>>> when I send mass data as string in $http_str
>>>>>>>>
>>>>>>>> the server feedback :
>>>>>>>>
>>>>>>>> The requested URL'S length exceeds the capacity limit for this server !!!
>>>>>>>>
>>>>>>>> BR
>>>>>>>> Rolance
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>> There is a limit of 1024 characters on get requests. Otherwise, you
>>>>>>> should use a post request. See the -query option of http for help.
>>>>>>>
>>>>>>> Harald
>>>>>>
>>>>>> hi Harald
>>>>>>
>>>>>> thanks for your advice , already try post still not work .
>>>>>>
>>>>>> do you have woring code for this ? I need send mass data to server , PHP work fine , but I want use tcl to do this action.
>>>>>>
>>>>>> Rolance
>>>>>>
>>>>> Working code ;-) ? That depends on your server.
>>>>>
>>>>> If you have PHP code working, you may post your PHP code...
>>>>> But first show, what is in your variable $http_str
>>>>>
>>>>> You should take the variable part (after the "?") as the query argument.
>>>>> The "?" should be removed.
>>>>>
>>>>> ::http::geturl "http://xxx.xxx.xxx/api/$http_str_before_question_mark"
>>>>> -query $http_str_after_question_mark
>>>>>
>>>>> Hope this helps,
>>>>> Harald
>>>> thanks for your advice
>>>> yes it server problem , some server will pass all my sending mass string to API .
>>>> use php need to call thrid party software , process not fast way.
>>>> will try your suggestion later
>>>>
>>>> BR
>>>> Rolance
>>>
>>> Hi all
>>> after try two upper two advice
>>> 1. uri::join not work ...
>>> 2. seem have some affect , but miss first parameter
>>>
>>> do someone have any ideal for post mass string to server use ::http::geturl or some better extension?
>>>
>>> BR
>>> Rolance
>>>
>> Dear Rolance,
>>
>> thank you for the answer.
>>
>> Your example was:
>> set tok [::http::geturl "http://xxx.xxx.xxx/api/$http_str" -headers
>> [list Authorization "Bearer -------"]]
>> Could you give an example for the content of $http_str ?
>>
>> Is the server public, so we could try it on our own ?
>>
>> Take care,
>> Harald
> Hi Harald
>
> thanks your example , to conquer long string issue. need to do further try handling issue
>
> the content is
>
> data is mass command or file (tranfer to base64 string)
>
>
> set http_str [::http::formatQuery trn_no AV220823028 filename tt3.gif file [::http::quoteString $data]]
>
> 1. work , but program nenver stop , need stop by manual .... success to pass long string ...
> set tok1 [::http::geturl "http://xxx.xxx.xxx.xxx/api/invofile" -query $http_str1 -headers [list Authorization "Bearer 3|xxxxxxxxxxx"]
>
> 2. not work , reply success 200 , but file not upload ....
> set tok1 [::http::geturl "http://xxx.xxx.xxx.xxx/api/invofile" -query "trn_no AV220823028 $http_str1" -headers [list Authorization "Bearer 3|xxxxxxxxxxx"]
>
> the server not public , sorry ...
>
> is another way , let me program timout it'self .... to conquer handing issue.
>
>
> BR
> Rolance

Hi Rolance,

so, you try to send a file contents.
it might be an idea to send the file data verbatim (not url encoded) and
set the mime type to the propper file type.
set h [open tt3.gif rb]
http::geturl "http://xxx.xxx.xxx.xxx/api/invofile" -method post
-headers [list Authorization "Bearer 3|xxxxxxxxxxx"] -channel $h
-timeout 10000000 -type image/gif]

You wrote in your initial post, that it works with php. Could you send
the php code which works for you ?

Take care,
Harald

Re: ::http::geturl long string issue

<82fe9661-7fd3-4481-a931-36ad2180b50fn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19948&group=comp.lang.tcl#19948

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a05:6214:d44:b0:496:c996:3f07 with SMTP id 4-20020a0562140d4400b00496c9963f07mr2598602qvr.69.1661418180238;
Thu, 25 Aug 2022 02:03:00 -0700 (PDT)
X-Received: by 2002:a05:6870:15c9:b0:101:e18b:d12d with SMTP id
k9-20020a05687015c900b00101e18bd12dmr5609657oad.51.1661418179793; Thu, 25 Aug
2022 02:02:59 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Thu, 25 Aug 2022 02:02:59 -0700 (PDT)
In-Reply-To: <te7aj8$3jqu9$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=116.12.58.57; posting-account=59xCUwoAAABx9tq6XUTZW-wQ1A7Z8t9L
NNTP-Posting-Host: 116.12.58.57
References: <54a3e3ae-2bb1-4b4d-80cb-8101d1703eb5n@googlegroups.com>
<te2h3n$301vc$1@dont-email.me> <f5418446-1a42-493d-894b-d55186246fb8n@googlegroups.com>
<te2lfr$30fhn$1@dont-email.me> <b8747314-e0f3-4a43-8cd5-550cbff8051cn@googlegroups.com>
<5f2d7e8c-21cd-4433-8224-fdc805a30693n@googlegroups.com> <te5d0r$3bchb$1@dont-email.me>
<c343dc89-05f2-4120-808b-950bb6442ae8n@googlegroups.com> <te7aj8$3jqu9$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <82fe9661-7fd3-4481-a931-36ad2180b50fn@googlegroups.com>
Subject: Re: ::http::geturl long string issue
From: rolance1@gmail.com (rola...@gmail.com)
Injection-Date: Thu, 25 Aug 2022 09:03:00 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 7731
 by: rola...@gmail.com - Thu, 25 Aug 2022 09:02 UTC

Harald Oehlmann 在 2022年8月25日 星期四晚上8:07:09 [UTC+12] 的信中寫道:
> Am 24.08.2022 um 22:10 schrieb rola...@gmail.com:
> > Harald Oehlmann 在 2022年8月25日 星期四凌晨2:36:15 [UTC+12] 的信中寫道:
> >> Am 24.08.2022 um 11:32 schrieb rola...@gmail.com:
> >>> rola...@gmail.com 在 2022年8月24日 星期三清晨7:55:27 [UTC+12] 的信中寫道:
> >>>> Harald Oehlmann 在 2022年8月24日 星期三凌晨1:42:23 [UTC+12] 的信中寫道:
> >>>>> Am 23.08.2022 um 15:15 schrieb rola...@gmail.com:
> >>>>>> Harald Oehlmann 在 2022年8月24日 星期三凌晨12:27:39 [UTC+12] 的信中寫道:
> >>>>>>> Am 23.08.2022 um 14:15 schrieb rola...@gmail.com:
> >>>>>>>> Hi everyone
> >>>>>>>>
> >>>>>>>> do someone give an direction to conquer long string issue
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> below will implement in less string ---> $http_str
> >>>>>>>>
> >>>>>>>> set tok [::http::geturl "http://xxx.xxx.xxx/api/$http_str" -headers [list Authorization "Bearer -------"]]
> >>>>>>>>
> >>>>>>>> when I send mass data as string in $http_str
> >>>>>>>>
> >>>>>>>> the server feedback :
> >>>>>>>>
> >>>>>>>> The requested URL'S length exceeds the capacity limit for this server !!!
> >>>>>>>>
> >>>>>>>> BR
> >>>>>>>> Rolance
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>> There is a limit of 1024 characters on get requests. Otherwise, you
> >>>>>>> should use a post request. See the -query option of http for help..
> >>>>>>>
> >>>>>>> Harald
> >>>>>>
> >>>>>> hi Harald
> >>>>>>
> >>>>>> thanks for your advice , already try post still not work .
> >>>>>>
> >>>>>> do you have woring code for this ? I need send mass data to server , PHP work fine , but I want use tcl to do this action.
> >>>>>>
> >>>>>> Rolance
> >>>>>>
> >>>>> Working code ;-) ? That depends on your server.
> >>>>>
> >>>>> If you have PHP code working, you may post your PHP code...
> >>>>> But first show, what is in your variable $http_str
> >>>>>
> >>>>> You should take the variable part (after the "?") as the query argument.
> >>>>> The "?" should be removed.
> >>>>>
> >>>>> ::http::geturl "http://xxx.xxx.xxx/api/$http_str_before_question_mark"
> >>>>> -query $http_str_after_question_mark
> >>>>>
> >>>>> Hope this helps,
> >>>>> Harald
> >>>> thanks for your advice
> >>>> yes it server problem , some server will pass all my sending mass string to API .
> >>>> use php need to call thrid party software , process not fast way.
> >>>> will try your suggestion later
> >>>>
> >>>> BR
> >>>> Rolance
> >>>
> >>> Hi all
> >>> after try two upper two advice
> >>> 1. uri::join not work ...
> >>> 2. seem have some affect , but miss first parameter
> >>>
> >>> do someone have any ideal for post mass string to server use ::http::geturl or some better extension?
> >>>
> >>> BR
> >>> Rolance
> >>>
> >> Dear Rolance,
> >>
> >> thank you for the answer.
> >>
> >> Your example was:
> >> set tok [::http::geturl "http://xxx.xxx.xxx/api/$http_str" -headers
> >> [list Authorization "Bearer -------"]]
> >> Could you give an example for the content of $http_str ?
> >>
> >> Is the server public, so we could try it on our own ?
> >>
> >> Take care,
> >> Harald
> > Hi Harald
> >
> > thanks your example , to conquer long string issue. need to do further try handling issue
> >
> > the content is
> >
> > data is mass command or file (tranfer to base64 string)
> >
> >
> > set http_str [::http::formatQuery trn_no AV220823028 filename tt3.gif file [::http::quoteString $data]]
> >
> > 1. work , but program nenver stop , need stop by manual .... success to pass long string ...
> > set tok1 [::http::geturl "http://xxx.xxx.xxx.xxx/api/invofile" -query $http_str1 -headers [list Authorization "Bearer 3|xxxxxxxxxxx"]
> >
> > 2. not work , reply success 200 , but file not upload ....
> > set tok1 [::http::geturl "http://xxx.xxx.xxx.xxx/api/invofile" -query "trn_no AV220823028 $http_str1" -headers [list Authorization "Bearer 3|xxxxxxxxxxx"]
> >
> > the server not public , sorry ...
> >
> > is another way , let me program timout it'self .... to conquer handing issue.
> >
> >
> > BR
> > Rolance
> Hi Rolance,
>
> so, you try to send a file contents.
> it might be an idea to send the file data verbatim (not url encoded) and
> set the mime type to the propper file type.
> set h [open tt3.gif rb]
> http::geturl "http://xxx.xxx.xxx.xxx/api/invofile" -method post
> -headers [list Authorization "Bearer 3|xxxxxxxxxxx"] -channel $h
> -timeout 10000000 -type image/gif]
>
> You wrote in your initial post, that it works with php. Could you send
> the php code which works for you ?
>
> Take care,
> Harald
Hi Harald

Great thanks for your code , will try and report the result later
for the php code is very simple ... because the api server develop by php , and send long string just like json type ...
data string example :
data_string:
{ "filename": "x2.png",
"file": "iVBORw0KGgoAAAANSUhEUgAAAOAAAADhCAMAAADmr0l2AAAAh1BMVEX///8AAADu7u7t7e3z8/P6+vrs7Oz29vb7+"
} curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
BR
Rolance

Re: ::http::geturl long string issue

<te7en2$3k65c$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19949&group=comp.lang.tcl#19949

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: wortkarg2@yahoo.de (Harald Oehlmann)
Newsgroups: comp.lang.tcl
Subject: Re: ::http::geturl long string issue
Date: Thu, 25 Aug 2022 11:17:23 +0200
Organization: A noiseless patient Spider
Lines: 166
Message-ID: <te7en2$3k65c$1@dont-email.me>
References: <54a3e3ae-2bb1-4b4d-80cb-8101d1703eb5n@googlegroups.com>
<te2h3n$301vc$1@dont-email.me>
<f5418446-1a42-493d-894b-d55186246fb8n@googlegroups.com>
<te2lfr$30fhn$1@dont-email.me>
<b8747314-e0f3-4a43-8cd5-550cbff8051cn@googlegroups.com>
<5f2d7e8c-21cd-4433-8224-fdc805a30693n@googlegroups.com>
<te5d0r$3bchb$1@dont-email.me>
<c343dc89-05f2-4120-808b-950bb6442ae8n@googlegroups.com>
<te7aj8$3jqu9$1@dont-email.me>
<82fe9661-7fd3-4481-a931-36ad2180b50fn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 25 Aug 2022 09:17:22 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="3c415aa13a14209fe00bf0587f62badc";
logging-data="3807404"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+penFYMHUKBK0VIxtXGTbm"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.13.0
Cancel-Lock: sha1:WaDsk7VjJRNzwwRvf8rUN3IeYAY=
In-Reply-To: <82fe9661-7fd3-4481-a931-36ad2180b50fn@googlegroups.com>
Content-Language: en-GB
 by: Harald Oehlmann - Thu, 25 Aug 2022 09:17 UTC

Am 25.08.2022 um 11:02 schrieb rola...@gmail.com:
> Harald Oehlmann 在 2022年8月25日 星期四晚上8:07:09 [UTC+12] 的信中寫道:
>> Am 24.08.2022 um 22:10 schrieb rola...@gmail.com:
>>> Harald Oehlmann 在 2022年8月25日 星期四凌晨2:36:15 [UTC+12] 的信中寫道:
>>>> Am 24.08.2022 um 11:32 schrieb rola...@gmail.com:
>>>>> rola...@gmail.com 在 2022年8月24日 星期三清晨7:55:27 [UTC+12] 的信中寫道:
>>>>>> Harald Oehlmann 在 2022年8月24日 星期三凌晨1:42:23 [UTC+12] 的信中寫道:
>>>>>>> Am 23.08.2022 um 15:15 schrieb rola...@gmail.com:
>>>>>>>> Harald Oehlmann 在 2022年8月24日 星期三凌晨12:27:39 [UTC+12] 的信中寫道:
>>>>>>>>> Am 23.08.2022 um 14:15 schrieb rola...@gmail.com:
>>>>>>>>>> Hi everyone
>>>>>>>>>>
>>>>>>>>>> do someone give an direction to conquer long string issue
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> below will implement in less string ---> $http_str
>>>>>>>>>>
>>>>>>>>>> set tok [::http::geturl "http://xxx.xxx.xxx/api/$http_str" -headers [list Authorization "Bearer -------"]]
>>>>>>>>>>
>>>>>>>>>> when I send mass data as string in $http_str
>>>>>>>>>>
>>>>>>>>>> the server feedback :
>>>>>>>>>>
>>>>>>>>>> The requested URL'S length exceeds the capacity limit for this server !!!
>>>>>>>>>>
>>>>>>>>>> BR
>>>>>>>>>> Rolance
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>> There is a limit of 1024 characters on get requests. Otherwise, you
>>>>>>>>> should use a post request. See the -query option of http for help.
>>>>>>>>>
>>>>>>>>> Harald
>>>>>>>>
>>>>>>>> hi Harald
>>>>>>>>
>>>>>>>> thanks for your advice , already try post still not work .
>>>>>>>>
>>>>>>>> do you have woring code for this ? I need send mass data to server , PHP work fine , but I want use tcl to do this action.
>>>>>>>>
>>>>>>>> Rolance
>>>>>>>>
>>>>>>> Working code ;-) ? That depends on your server.
>>>>>>>
>>>>>>> If you have PHP code working, you may post your PHP code...
>>>>>>> But first show, what is in your variable $http_str
>>>>>>>
>>>>>>> You should take the variable part (after the "?") as the query argument.
>>>>>>> The "?" should be removed.
>>>>>>>
>>>>>>> ::http::geturl "http://xxx.xxx.xxx/api/$http_str_before_question_mark"
>>>>>>> -query $http_str_after_question_mark
>>>>>>>
>>>>>>> Hope this helps,
>>>>>>> Harald
>>>>>> thanks for your advice
>>>>>> yes it server problem , some server will pass all my sending mass string to API .
>>>>>> use php need to call thrid party software , process not fast way.
>>>>>> will try your suggestion later
>>>>>>
>>>>>> BR
>>>>>> Rolance
>>>>>
>>>>> Hi all
>>>>> after try two upper two advice
>>>>> 1. uri::join not work ...
>>>>> 2. seem have some affect , but miss first parameter
>>>>>
>>>>> do someone have any ideal for post mass string to server use ::http::geturl or some better extension?
>>>>>
>>>>> BR
>>>>> Rolance
>>>>>
>>>> Dear Rolance,
>>>>
>>>> thank you for the answer.
>>>>
>>>> Your example was:
>>>> set tok [::http::geturl "http://xxx.xxx.xxx/api/$http_str" -headers
>>>> [list Authorization "Bearer -------"]]
>>>> Could you give an example for the content of $http_str ?
>>>>
>>>> Is the server public, so we could try it on our own ?
>>>>
>>>> Take care,
>>>> Harald
>>> Hi Harald
>>>
>>> thanks your example , to conquer long string issue. need to do further try handling issue
>>>
>>> the content is
>>>
>>> data is mass command or file (tranfer to base64 string)
>>>
>>>
>>> set http_str [::http::formatQuery trn_no AV220823028 filename tt3.gif file [::http::quoteString $data]]
>>>
>>> 1. work , but program nenver stop , need stop by manual .... success to pass long string ...
>>> set tok1 [::http::geturl "http://xxx.xxx.xxx.xxx/api/invofile" -query $http_str1 -headers [list Authorization "Bearer 3|xxxxxxxxxxx"]
>>>
>>> 2. not work , reply success 200 , but file not upload ....
>>> set tok1 [::http::geturl "http://xxx.xxx.xxx.xxx/api/invofile" -query "trn_no AV220823028 $http_str1" -headers [list Authorization "Bearer 3|xxxxxxxxxxx"]
>>>
>>> the server not public , sorry ...
>>>
>>> is another way , let me program timout it'self .... to conquer handing issue.
>>>
>>>
>>> BR
>>> Rolance
>> Hi Rolance,
>>
>> so, you try to send a file contents.
>> it might be an idea to send the file data verbatim (not url encoded) and
>> set the mime type to the propper file type.
>> set h [open tt3.gif rb]
>> http::geturl "http://xxx.xxx.xxx.xxx/api/invofile" -method post
>> -headers [list Authorization "Bearer 3|xxxxxxxxxxx"] -channel $h
>> -timeout 10000000 -type image/gif]
>>
>> You wrote in your initial post, that it works with php. Could you send
>> the php code which works for you ?
>>
>> Take care,
>> Harald
> Hi Harald
>
> Great thanks for your code , will try and report the result later
> for the php code is very simple ... because the api server develop by php , and send long string just like json type ...
> data string example :
> data_string:
> {
> "filename": "x2.png",
> "file": "iVBORw0KGgoAAAANSUhEUgAAAOAAAADhCAMAAADmr0l2AAAAh1BMVEX///8AAADu7u7t7e3z8/P6+vrs7Oz29vb7+"
> }
> curl_setopt($ch, CURLOPT_POST, 1);
> curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
> curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
> curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
> BR
> Rolance

Hi Rolance,

thank you for the PHP code. I suppose, it is incomplete, as the
authentification is missing.

IMHO, you may do the same in TCL. Here is an untested sketch.

set data_string "
{ "filename": "x2.png",
"file":
"iVBORw0KGgoAAAANSUhEUgAAAOAAAADhCAMAAADmr0l2AAAAh1BMVEX///8AAADu7u7t7e3z8/P6+vrs7Oz29vb7+"
}"

http::geturl "http://xxx.xxx.xxx.xxx/api/invofile" -query $data_string
headers [list Authorization "Bearer 3|xxxxxxxxxxx"] -timeout 10000000
-type application/json

I added the mime-type for json.

Hope this helps,
Harald

Re: ::http::geturl long string issue

<d18a0d1a-00ff-4068-82f7-7bac61f44725n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19950&group=comp.lang.tcl#19950

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:ae9:e404:0:b0:6bb:d8c0:381c with SMTP id q4-20020ae9e404000000b006bbd8c0381cmr2420137qkc.459.1661424094032;
Thu, 25 Aug 2022 03:41:34 -0700 (PDT)
X-Received: by 2002:aca:d0a:0:b0:343:4049:689b with SMTP id
10-20020aca0d0a000000b003434049689bmr1444648oin.56.1661424093761; Thu, 25 Aug
2022 03:41:33 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Thu, 25 Aug 2022 03:41:33 -0700 (PDT)
In-Reply-To: <te7en2$3k65c$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=116.12.58.57; posting-account=59xCUwoAAABx9tq6XUTZW-wQ1A7Z8t9L
NNTP-Posting-Host: 116.12.58.57
References: <54a3e3ae-2bb1-4b4d-80cb-8101d1703eb5n@googlegroups.com>
<te2h3n$301vc$1@dont-email.me> <f5418446-1a42-493d-894b-d55186246fb8n@googlegroups.com>
<te2lfr$30fhn$1@dont-email.me> <b8747314-e0f3-4a43-8cd5-550cbff8051cn@googlegroups.com>
<5f2d7e8c-21cd-4433-8224-fdc805a30693n@googlegroups.com> <te5d0r$3bchb$1@dont-email.me>
<c343dc89-05f2-4120-808b-950bb6442ae8n@googlegroups.com> <te7aj8$3jqu9$1@dont-email.me>
<82fe9661-7fd3-4481-a931-36ad2180b50fn@googlegroups.com> <te7en2$3k65c$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d18a0d1a-00ff-4068-82f7-7bac61f44725n@googlegroups.com>
Subject: Re: ::http::geturl long string issue
From: rolance1@gmail.com (rola...@gmail.com)
Injection-Date: Thu, 25 Aug 2022 10:41:34 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 10359
 by: rola...@gmail.com - Thu, 25 Aug 2022 10:41 UTC

Harald Oehlmann 在 2022年8月25日 星期四晚上9:17:27 [UTC+12] 的信中寫道:
> Am 25.08.2022 um 11:02 schrieb rola...@gmail.com:
> > Harald Oehlmann 在 2022年8月25日 星期四晚上8:07:09 [UTC+12] 的信中寫道:
> >> Am 24.08.2022 um 22:10 schrieb rola...@gmail.com:
> >>> Harald Oehlmann 在 2022年8月25日 星期四凌晨2:36:15 [UTC+12] 的信中寫道:
> >>>> Am 24.08.2022 um 11:32 schrieb rola...@gmail.com:
> >>>>> rola...@gmail.com 在 2022年8月24日 星期三清晨7:55:27 [UTC+12] 的信中寫道:
> >>>>>> Harald Oehlmann 在 2022年8月24日 星期三凌晨1:42:23 [UTC+12] 的信中寫道:
> >>>>>>> Am 23.08.2022 um 15:15 schrieb rola...@gmail.com:
> >>>>>>>> Harald Oehlmann 在 2022年8月24日 星期三凌晨12:27:39 [UTC+12] 的信中寫道:
> >>>>>>>>> Am 23.08.2022 um 14:15 schrieb rola...@gmail.com:
> >>>>>>>>>> Hi everyone
> >>>>>>>>>>
> >>>>>>>>>> do someone give an direction to conquer long string issue
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>> below will implement in less string ---> $http_str
> >>>>>>>>>>
> >>>>>>>>>> set tok [::http::geturl "http://xxx.xxx.xxx/api/$http_str" -headers [list Authorization "Bearer -------"]]
> >>>>>>>>>>
> >>>>>>>>>> when I send mass data as string in $http_str
> >>>>>>>>>>
> >>>>>>>>>> the server feedback :
> >>>>>>>>>>
> >>>>>>>>>> The requested URL'S length exceeds the capacity limit for this server !!!
> >>>>>>>>>>
> >>>>>>>>>> BR
> >>>>>>>>>> Rolance
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>> There is a limit of 1024 characters on get requests. Otherwise, you
> >>>>>>>>> should use a post request. See the -query option of http for help.
> >>>>>>>>>
> >>>>>>>>> Harald
> >>>>>>>>
> >>>>>>>> hi Harald
> >>>>>>>>
> >>>>>>>> thanks for your advice , already try post still not work .
> >>>>>>>>
> >>>>>>>> do you have woring code for this ? I need send mass data to server , PHP work fine , but I want use tcl to do this action.
> >>>>>>>>
> >>>>>>>> Rolance
> >>>>>>>>
> >>>>>>> Working code ;-) ? That depends on your server.
> >>>>>>>
> >>>>>>> If you have PHP code working, you may post your PHP code...
> >>>>>>> But first show, what is in your variable $http_str
> >>>>>>>
> >>>>>>> You should take the variable part (after the "?") as the query argument.
> >>>>>>> The "?" should be removed.
> >>>>>>>
> >>>>>>> ::http::geturl "http://xxx.xxx.xxx/api/$http_str_before_question_mark"
> >>>>>>> -query $http_str_after_question_mark
> >>>>>>>
> >>>>>>> Hope this helps,
> >>>>>>> Harald
> >>>>>> thanks for your advice
> >>>>>> yes it server problem , some server will pass all my sending mass string to API .
> >>>>>> use php need to call thrid party software , process not fast way.
> >>>>>> will try your suggestion later
> >>>>>>
> >>>>>> BR
> >>>>>> Rolance
> >>>>>
> >>>>> Hi all
> >>>>> after try two upper two advice
> >>>>> 1. uri::join not work ...
> >>>>> 2. seem have some affect , but miss first parameter
> >>>>>
> >>>>> do someone have any ideal for post mass string to server use ::http::geturl or some better extension?
> >>>>>
> >>>>> BR
> >>>>> Rolance
> >>>>>
> >>>> Dear Rolance,
> >>>>
> >>>> thank you for the answer.
> >>>>
> >>>> Your example was:
> >>>> set tok [::http::geturl "http://xxx.xxx.xxx/api/$http_str" -headers
> >>>> [list Authorization "Bearer -------"]]
> >>>> Could you give an example for the content of $http_str ?
> >>>>
> >>>> Is the server public, so we could try it on our own ?
> >>>>
> >>>> Take care,
> >>>> Harald
> >>> Hi Harald
> >>>
> >>> thanks your example , to conquer long string issue. need to do further try handling issue
> >>>
> >>> the content is
> >>>
> >>> data is mass command or file (tranfer to base64 string)
> >>>
> >>>
> >>> set http_str [::http::formatQuery trn_no AV220823028 filename tt3.gif file [::http::quoteString $data]]
> >>>
> >>> 1. work , but program nenver stop , need stop by manual .... success to pass long string ...
> >>> set tok1 [::http::geturl "http://xxx.xxx.xxx.xxx/api/invofile" -query $http_str1 -headers [list Authorization "Bearer 3|xxxxxxxxxxx"]
> >>>
> >>> 2. not work , reply success 200 , but file not upload ....
> >>> set tok1 [::http::geturl "http://xxx.xxx.xxx.xxx/api/invofile" -query "trn_no AV220823028 $http_str1" -headers [list Authorization "Bearer 3|xxxxxxxxxxx"]
> >>>
> >>> the server not public , sorry ...
> >>>
> >>> is another way , let me program timout it'self .... to conquer handing issue.
> >>>
> >>>
> >>> BR
> >>> Rolance
> >> Hi Rolance,
> >>
> >> so, you try to send a file contents.
> >> it might be an idea to send the file data verbatim (not url encoded) and
> >> set the mime type to the propper file type.
> >> set h [open tt3.gif rb]
> >> http::geturl "http://xxx.xxx.xxx.xxx/api/invofile" -method post
> >> -headers [list Authorization "Bearer 3|xxxxxxxxxxx"] -channel $h
> >> -timeout 10000000 -type image/gif]
> >>
> >> You wrote in your initial post, that it works with php. Could you send
> >> the php code which works for you ?
> >>
> >> Take care,
> >> Harald
> > Hi Harald
> >
> > Great thanks for your code , will try and report the result later
> > for the php code is very simple ... because the api server develop by php , and send long string just like json type ...
> > data string example :
> > data_string:
> > {
> > "filename": "x2.png",
> > "file": "iVBORw0KGgoAAAANSUhEUgAAAOAAAADhCAMAAADmr0l2AAAAh1BMVEX///8AAADu7u7t7e3z8/P6+vrs7Oz29vb7+"
> > }
> > curl_setopt($ch, CURLOPT_POST, 1);
> > curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
> > curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
> > curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
> > BR
> > Rolance
> Hi Rolance,
>
> thank you for the PHP code. I suppose, it is incomplete, as the
> authentification is missing.
>
> IMHO, you may do the same in TCL. Here is an untested sketch.
>
> set data_string "
> {
> "filename": "x2.png",
> "file":
> "iVBORw0KGgoAAAANSUhEUgAAAOAAAADhCAMAAADmr0l2AAAAh1BMVEX///8AAADu7u7t7e3z8/P6+vrs7Oz29vb7+"
> }"
> http::geturl "http://xxx.xxx.xxx.xxx/api/invofile" -query $data_string
> headers [list Authorization "Bearer 3|xxxxxxxxxxx"] -timeout 10000000
> -type application/json
>
> I added the mime-type for json.
>
> Hope this helps,
> Harald


Click here to read the complete article
Re: ::http::geturl long string issue

<te7lb5$3kopq$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19951&group=comp.lang.tcl#19951

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: wortkarg2@yahoo.de (Harald Oehlmann)
Newsgroups: comp.lang.tcl
Subject: Re: ::http::geturl long string issue
Date: Thu, 25 Aug 2022 13:10:30 +0200
Organization: A noiseless patient Spider
Lines: 219
Message-ID: <te7lb5$3kopq$1@dont-email.me>
References: <54a3e3ae-2bb1-4b4d-80cb-8101d1703eb5n@googlegroups.com>
<te2h3n$301vc$1@dont-email.me>
<f5418446-1a42-493d-894b-d55186246fb8n@googlegroups.com>
<te2lfr$30fhn$1@dont-email.me>
<b8747314-e0f3-4a43-8cd5-550cbff8051cn@googlegroups.com>
<5f2d7e8c-21cd-4433-8224-fdc805a30693n@googlegroups.com>
<te5d0r$3bchb$1@dont-email.me>
<c343dc89-05f2-4120-808b-950bb6442ae8n@googlegroups.com>
<te7aj8$3jqu9$1@dont-email.me>
<82fe9661-7fd3-4481-a931-36ad2180b50fn@googlegroups.com>
<te7en2$3k65c$1@dont-email.me>
<d18a0d1a-00ff-4068-82f7-7bac61f44725n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 25 Aug 2022 11:10:29 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="3c415aa13a14209fe00bf0587f62badc";
logging-data="3826490"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18tJ1F8kqVZK38i7pOQj8Hy"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.13.0
Cancel-Lock: sha1:ZP0u98FEsZXck0IupPFzxAWEJJY=
In-Reply-To: <d18a0d1a-00ff-4068-82f7-7bac61f44725n@googlegroups.com>
Content-Language: en-GB
 by: Harald Oehlmann - Thu, 25 Aug 2022 11:10 UTC

Am 25.08.2022 um 12:41 schrieb rola...@gmail.com:
> Harald Oehlmann 在 2022年8月25日 星期四晚上9:17:27 [UTC+12] 的信中寫道:
>> Am 25.08.2022 um 11:02 schrieb rola...@gmail.com:
>>> Harald Oehlmann 在 2022年8月25日 星期四晚上8:07:09 [UTC+12] 的信中寫道:
>>>> Am 24.08.2022 um 22:10 schrieb rola...@gmail.com:
>>>>> Harald Oehlmann 在 2022年8月25日 星期四凌晨2:36:15 [UTC+12] 的信中寫道:
>>>>>> Am 24.08.2022 um 11:32 schrieb rola...@gmail.com:
>>>>>>> rola...@gmail.com 在 2022年8月24日 星期三清晨7:55:27 [UTC+12] 的信中寫道:
>>>>>>>> Harald Oehlmann 在 2022年8月24日 星期三凌晨1:42:23 [UTC+12] 的信中寫道:
>>>>>>>>> Am 23.08.2022 um 15:15 schrieb rola...@gmail.com:
>>>>>>>>>> Harald Oehlmann 在 2022年8月24日 星期三凌晨12:27:39 [UTC+12] 的信中寫道:
>>>>>>>>>>> Am 23.08.2022 um 14:15 schrieb rola...@gmail.com:
>>>>>>>>>>>> Hi everyone
>>>>>>>>>>>>
>>>>>>>>>>>> do someone give an direction to conquer long string issue
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> below will implement in less string ---> $http_str
>>>>>>>>>>>>
>>>>>>>>>>>> set tok [::http::geturl "http://xxx.xxx.xxx/api/$http_str" -headers [list Authorization "Bearer -------"]]
>>>>>>>>>>>>
>>>>>>>>>>>> when I send mass data as string in $http_str
>>>>>>>>>>>>
>>>>>>>>>>>> the server feedback :
>>>>>>>>>>>>
>>>>>>>>>>>> The requested URL'S length exceeds the capacity limit for this server !!!
>>>>>>>>>>>>
>>>>>>>>>>>> BR
>>>>>>>>>>>> Rolance
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>> There is a limit of 1024 characters on get requests. Otherwise, you
>>>>>>>>>>> should use a post request. See the -query option of http for help.
>>>>>>>>>>>
>>>>>>>>>>> Harald
>>>>>>>>>>
>>>>>>>>>> hi Harald
>>>>>>>>>>
>>>>>>>>>> thanks for your advice , already try post still not work .
>>>>>>>>>>
>>>>>>>>>> do you have woring code for this ? I need send mass data to server , PHP work fine , but I want use tcl to do this action.
>>>>>>>>>>
>>>>>>>>>> Rolance
>>>>>>>>>>
>>>>>>>>> Working code ;-) ? That depends on your server.
>>>>>>>>>
>>>>>>>>> If you have PHP code working, you may post your PHP code...
>>>>>>>>> But first show, what is in your variable $http_str
>>>>>>>>>
>>>>>>>>> You should take the variable part (after the "?") as the query argument.
>>>>>>>>> The "?" should be removed.
>>>>>>>>>
>>>>>>>>> ::http::geturl "http://xxx.xxx.xxx/api/$http_str_before_question_mark"
>>>>>>>>> -query $http_str_after_question_mark
>>>>>>>>>
>>>>>>>>> Hope this helps,
>>>>>>>>> Harald
>>>>>>>> thanks for your advice
>>>>>>>> yes it server problem , some server will pass all my sending mass string to API .
>>>>>>>> use php need to call thrid party software , process not fast way.
>>>>>>>> will try your suggestion later
>>>>>>>>
>>>>>>>> BR
>>>>>>>> Rolance
>>>>>>>
>>>>>>> Hi all
>>>>>>> after try two upper two advice
>>>>>>> 1. uri::join not work ...
>>>>>>> 2. seem have some affect , but miss first parameter
>>>>>>>
>>>>>>> do someone have any ideal for post mass string to server use ::http::geturl or some better extension?
>>>>>>>
>>>>>>> BR
>>>>>>> Rolance
>>>>>>>
>>>>>> Dear Rolance,
>>>>>>
>>>>>> thank you for the answer.
>>>>>>
>>>>>> Your example was:
>>>>>> set tok [::http::geturl "http://xxx.xxx.xxx/api/$http_str" -headers
>>>>>> [list Authorization "Bearer -------"]]
>>>>>> Could you give an example for the content of $http_str ?
>>>>>>
>>>>>> Is the server public, so we could try it on our own ?
>>>>>>
>>>>>> Take care,
>>>>>> Harald
>>>>> Hi Harald
>>>>>
>>>>> thanks your example , to conquer long string issue. need to do further try handling issue
>>>>>
>>>>> the content is
>>>>>
>>>>> data is mass command or file (tranfer to base64 string)
>>>>>
>>>>>
>>>>> set http_str [::http::formatQuery trn_no AV220823028 filename tt3.gif file [::http::quoteString $data]]
>>>>>
>>>>> 1. work , but program nenver stop , need stop by manual .... success to pass long string ...
>>>>> set tok1 [::http::geturl "http://xxx.xxx.xxx.xxx/api/invofile" -query $http_str1 -headers [list Authorization "Bearer 3|xxxxxxxxxxx"]
>>>>>
>>>>> 2. not work , reply success 200 , but file not upload ....
>>>>> set tok1 [::http::geturl "http://xxx.xxx.xxx.xxx/api/invofile" -query "trn_no AV220823028 $http_str1" -headers [list Authorization "Bearer 3|xxxxxxxxxxx"]
>>>>>
>>>>> the server not public , sorry ...
>>>>>
>>>>> is another way , let me program timout it'self .... to conquer handing issue.
>>>>>
>>>>>
>>>>> BR
>>>>> Rolance
>>>> Hi Rolance,
>>>>
>>>> so, you try to send a file contents.
>>>> it might be an idea to send the file data verbatim (not url encoded) and
>>>> set the mime type to the propper file type.
>>>> set h [open tt3.gif rb]
>>>> http::geturl "http://xxx.xxx.xxx.xxx/api/invofile" -method post
>>>> -headers [list Authorization "Bearer 3|xxxxxxxxxxx"] -channel $h
>>>> -timeout 10000000 -type image/gif]
>>>>
>>>> You wrote in your initial post, that it works with php. Could you send
>>>> the php code which works for you ?
>>>>
>>>> Take care,
>>>> Harald
>>> Hi Harald
>>>
>>> Great thanks for your code , will try and report the result later
>>> for the php code is very simple ... because the api server develop by php , and send long string just like json type ...
>>> data string example :
>>> data_string:
>>> {
>>> "filename": "x2.png",
>>> "file": "iVBORw0KGgoAAAANSUhEUgAAAOAAAADhCAMAAADmr0l2AAAAh1BMVEX///8AAADu7u7t7e3z8/P6+vrs7Oz29vb7+"
>>> }
>>> curl_setopt($ch, CURLOPT_POST, 1);
>>> curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
>>> curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
>>> curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
>>> BR
>>> Rolance
>> Hi Rolance,
>>
>> thank you for the PHP code. I suppose, it is incomplete, as the
>> authentification is missing.
>>
>> IMHO, you may do the same in TCL. Here is an untested sketch.
>>
>> set data_string "
>> {
>> "filename": "x2.png",
>> "file":
>> "iVBORw0KGgoAAAANSUhEUgAAAOAAAADhCAMAAADmr0l2AAAAh1BMVEX///8AAADu7u7t7e3z8/P6+vrs7Oz29vb7+"
>> }"
>> http::geturl "http://xxx.xxx.xxx.xxx/api/invofile" -query $data_string
>> headers [list Authorization "Bearer 3|xxxxxxxxxxx"] -timeout 10000000
>> -type application/json
>>
>> I added the mime-type for json.
>>
>> Hope this helps,
>> Harald
>
> Hi harald
>
> great thanks for your code , the test result as below.
>
> 1.set h [open tt3.gif rb]
> http::geturl "http://xxx.xxx.xxx.xxx/api/invofile" -method post
> -headers [list Authorization "Bearer 3|xxxxxxxxxxx"] -channel $h
> -timeout 10000000 -type image/gif]
>
> not work , the server will receive BASE64 string to it's database
> -timeout no affect
>
> 2.
> set data_string "
> {
> "filename": "x2.png",
> "file":
> "iVBORw0KGgoAAAANSUhEUgAAAOAAAADhCAMAAADmr0l2AAAAh1BMVEX///8AAADu7u7t7e3z8/P6+vrs7Oz29vb7+"
> }"
> http::geturl "http://xxx.xxx.xxx.xxx/api/invofile" -query $data_string
> headers [list Authorization "Bearer 3|xxxxxxxxxxx"] -timeout 10000000
> -type application/json
>
> work in small size picture , less string
> if the string as 1-2MB still hanging ... timeout no affect ...
>
>
> as now , below code is the best way to work , but the hanging issue still not solved by add timeout ....
> it's seem occupy the socket , no signal to let program already finish ...
> set tok1 [::http::geturl "http://xxx.xxx.xxx.xxx/api/invofile" -query $http_str1 -headers [list Authorization "Bearer 3|xxxxxxxxx"]]
>
> do you have any ideal to conquer this , may by another way ..
>
> BR
> Rolance
>
>


Click here to read the complete article
Re: ::http::geturl long string issue

<805d9dd7-0668-469c-a2d6-0ed127528c78n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19952&group=comp.lang.tcl#19952

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a0c:8e8d:0:b0:496:b53d:c775 with SMTP id x13-20020a0c8e8d000000b00496b53dc775mr3230560qvb.36.1661430133172;
Thu, 25 Aug 2022 05:22:13 -0700 (PDT)
X-Received: by 2002:a05:6870:4606:b0:10d:c8b2:7f7d with SMTP id
z6-20020a056870460600b0010dc8b27f7dmr5815405oao.238.1661430132902; Thu, 25
Aug 2022 05:22:12 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Thu, 25 Aug 2022 05:22:12 -0700 (PDT)
In-Reply-To: <te7lb5$3kopq$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=116.12.58.57; posting-account=59xCUwoAAABx9tq6XUTZW-wQ1A7Z8t9L
NNTP-Posting-Host: 116.12.58.57
References: <54a3e3ae-2bb1-4b4d-80cb-8101d1703eb5n@googlegroups.com>
<te2h3n$301vc$1@dont-email.me> <f5418446-1a42-493d-894b-d55186246fb8n@googlegroups.com>
<te2lfr$30fhn$1@dont-email.me> <b8747314-e0f3-4a43-8cd5-550cbff8051cn@googlegroups.com>
<5f2d7e8c-21cd-4433-8224-fdc805a30693n@googlegroups.com> <te5d0r$3bchb$1@dont-email.me>
<c343dc89-05f2-4120-808b-950bb6442ae8n@googlegroups.com> <te7aj8$3jqu9$1@dont-email.me>
<82fe9661-7fd3-4481-a931-36ad2180b50fn@googlegroups.com> <te7en2$3k65c$1@dont-email.me>
<d18a0d1a-00ff-4068-82f7-7bac61f44725n@googlegroups.com> <te7lb5$3kopq$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <805d9dd7-0668-469c-a2d6-0ed127528c78n@googlegroups.com>
Subject: Re: ::http::geturl long string issue
From: rolance1@gmail.com (rola...@gmail.com)
Injection-Date: Thu, 25 Aug 2022 12:22:13 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 12141
 by: rola...@gmail.com - Thu, 25 Aug 2022 12:22 UTC

Harald Oehlmann 在 2022年8月25日 星期四晚上11:10:34 [UTC+12] 的信中寫道:
> Am 25.08.2022 um 12:41 schrieb rola...@gmail.com:
> > Harald Oehlmann 在 2022年8月25日 星期四晚上9:17:27 [UTC+12] 的信中寫道:
> >> Am 25.08.2022 um 11:02 schrieb rola...@gmail.com:
> >>> Harald Oehlmann 在 2022年8月25日 星期四晚上8:07:09 [UTC+12] 的信中寫道:
> >>>> Am 24.08.2022 um 22:10 schrieb rola...@gmail.com:
> >>>>> Harald Oehlmann 在 2022年8月25日 星期四凌晨2:36:15 [UTC+12] 的信中寫道:
> >>>>>> Am 24.08.2022 um 11:32 schrieb rola...@gmail.com:
> >>>>>>> rola...@gmail.com 在 2022年8月24日 星期三清晨7:55:27 [UTC+12] 的信中寫道:
> >>>>>>>> Harald Oehlmann 在 2022年8月24日 星期三凌晨1:42:23 [UTC+12] 的信中寫道:
> >>>>>>>>> Am 23.08.2022 um 15:15 schrieb rola...@gmail.com:
> >>>>>>>>>> Harald Oehlmann 在 2022年8月24日 星期三凌晨12:27:39 [UTC+12] 的信中寫道:
> >>>>>>>>>>> Am 23.08.2022 um 14:15 schrieb rola...@gmail.com:
> >>>>>>>>>>>> Hi everyone
> >>>>>>>>>>>>
> >>>>>>>>>>>> do someone give an direction to conquer long string issue
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>> below will implement in less string ---> $http_str
> >>>>>>>>>>>>
> >>>>>>>>>>>> set tok [::http::geturl "http://xxx.xxx.xxx/api/$http_str" -headers [list Authorization "Bearer -------"]]
> >>>>>>>>>>>>
> >>>>>>>>>>>> when I send mass data as string in $http_str
> >>>>>>>>>>>>
> >>>>>>>>>>>> the server feedback :
> >>>>>>>>>>>>
> >>>>>>>>>>>> The requested URL'S length exceeds the capacity limit for this server !!!
> >>>>>>>>>>>>
> >>>>>>>>>>>> BR
> >>>>>>>>>>>> Rolance
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>> There is a limit of 1024 characters on get requests. Otherwise, you
> >>>>>>>>>>> should use a post request. See the -query option of http for help.
> >>>>>>>>>>>
> >>>>>>>>>>> Harald
> >>>>>>>>>>
> >>>>>>>>>> hi Harald
> >>>>>>>>>>
> >>>>>>>>>> thanks for your advice , already try post still not work .
> >>>>>>>>>>
> >>>>>>>>>> do you have woring code for this ? I need send mass data to server , PHP work fine , but I want use tcl to do this action.
> >>>>>>>>>>
> >>>>>>>>>> Rolance
> >>>>>>>>>>
> >>>>>>>>> Working code ;-) ? That depends on your server.
> >>>>>>>>>
> >>>>>>>>> If you have PHP code working, you may post your PHP code...
> >>>>>>>>> But first show, what is in your variable $http_str
> >>>>>>>>>
> >>>>>>>>> You should take the variable part (after the "?") as the query argument.
> >>>>>>>>> The "?" should be removed.
> >>>>>>>>>
> >>>>>>>>> ::http::geturl "http://xxx.xxx.xxx/api/$http_str_before_question_mark"
> >>>>>>>>> -query $http_str_after_question_mark
> >>>>>>>>>
> >>>>>>>>> Hope this helps,
> >>>>>>>>> Harald
> >>>>>>>> thanks for your advice
> >>>>>>>> yes it server problem , some server will pass all my sending mass string to API .
> >>>>>>>> use php need to call thrid party software , process not fast way..
> >>>>>>>> will try your suggestion later
> >>>>>>>>
> >>>>>>>> BR
> >>>>>>>> Rolance
> >>>>>>>
> >>>>>>> Hi all
> >>>>>>> after try two upper two advice
> >>>>>>> 1. uri::join not work ...
> >>>>>>> 2. seem have some affect , but miss first parameter
> >>>>>>>
> >>>>>>> do someone have any ideal for post mass string to server use ::http::geturl or some better extension?
> >>>>>>>
> >>>>>>> BR
> >>>>>>> Rolance
> >>>>>>>
> >>>>>> Dear Rolance,
> >>>>>>
> >>>>>> thank you for the answer.
> >>>>>>
> >>>>>> Your example was:
> >>>>>> set tok [::http::geturl "http://xxx.xxx.xxx/api/$http_str" -headers
> >>>>>> [list Authorization "Bearer -------"]]
> >>>>>> Could you give an example for the content of $http_str ?
> >>>>>>
> >>>>>> Is the server public, so we could try it on our own ?
> >>>>>>
> >>>>>> Take care,
> >>>>>> Harald
> >>>>> Hi Harald
> >>>>>
> >>>>> thanks your example , to conquer long string issue. need to do further try handling issue
> >>>>>
> >>>>> the content is
> >>>>>
> >>>>> data is mass command or file (tranfer to base64 string)
> >>>>>
> >>>>>
> >>>>> set http_str [::http::formatQuery trn_no AV220823028 filename tt3.gif file [::http::quoteString $data]]
> >>>>>
> >>>>> 1. work , but program nenver stop , need stop by manual .... success to pass long string ...
> >>>>> set tok1 [::http::geturl "http://xxx.xxx.xxx.xxx/api/invofile" -query $http_str1 -headers [list Authorization "Bearer 3|xxxxxxxxxxx"]
> >>>>>
> >>>>> 2. not work , reply success 200 , but file not upload ....
> >>>>> set tok1 [::http::geturl "http://xxx.xxx.xxx.xxx/api/invofile" -query "trn_no AV220823028 $http_str1" -headers [list Authorization "Bearer 3|xxxxxxxxxxx"]
> >>>>>
> >>>>> the server not public , sorry ...
> >>>>>
> >>>>> is another way , let me program timout it'self .... to conquer handing issue.
> >>>>>
> >>>>>
> >>>>> BR
> >>>>> Rolance
> >>>> Hi Rolance,
> >>>>
> >>>> so, you try to send a file contents.
> >>>> it might be an idea to send the file data verbatim (not url encoded) and
> >>>> set the mime type to the propper file type.
> >>>> set h [open tt3.gif rb]
> >>>> http::geturl "http://xxx.xxx.xxx.xxx/api/invofile" -method post
> >>>> -headers [list Authorization "Bearer 3|xxxxxxxxxxx"] -channel $h
> >>>> -timeout 10000000 -type image/gif]
> >>>>
> >>>> You wrote in your initial post, that it works with php. Could you send
> >>>> the php code which works for you ?
> >>>>
> >>>> Take care,
> >>>> Harald
> >>> Hi Harald
> >>>
> >>> Great thanks for your code , will try and report the result later
> >>> for the php code is very simple ... because the api server develop by php , and send long string just like json type ...
> >>> data string example :
> >>> data_string:
> >>> {
> >>> "filename": "x2.png",
> >>> "file": "iVBORw0KGgoAAAANSUhEUgAAAOAAAADhCAMAAADmr0l2AAAAh1BMVEX///8AAADu7u7t7e3z8/P6+vrs7Oz29vb7+"
> >>> }
> >>> curl_setopt($ch, CURLOPT_POST, 1);
> >>> curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
> >>> curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
> >>> curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
> >>> BR
> >>> Rolance
> >> Hi Rolance,
> >>
> >> thank you for the PHP code. I suppose, it is incomplete, as the
> >> authentification is missing.
> >>
> >> IMHO, you may do the same in TCL. Here is an untested sketch.
> >>
> >> set data_string "
> >> {
> >> "filename": "x2.png",
> >> "file":
> >> "iVBORw0KGgoAAAANSUhEUgAAAOAAAADhCAMAAADmr0l2AAAAh1BMVEX///8AAADu7u7t7e3z8/P6+vrs7Oz29vb7+"
> >> }"
> >> http::geturl "http://xxx.xxx.xxx.xxx/api/invofile" -query $data_string
> >> headers [list Authorization "Bearer 3|xxxxxxxxxxx"] -timeout 10000000
> >> -type application/json
> >>
> >> I added the mime-type for json.
> >>
> >> Hope this helps,
> >> Harald
> >
> > Hi harald
> >
> > great thanks for your code , the test result as below.
> >
> > 1.set h [open tt3.gif rb]
> > http::geturl "http://xxx.xxx.xxx.xxx/api/invofile" -method post
> > -headers [list Authorization "Bearer 3|xxxxxxxxxxx"] -channel $h
> > -timeout 10000000 -type image/gif]
> >
> > not work , the server will receive BASE64 string to it's database
> > -timeout no affect
> >
> > 2.
> > set data_string "
> > {
> > "filename": "x2.png",
> > "file":
> > "iVBORw0KGgoAAAANSUhEUgAAAOAAAADhCAMAAADmr0l2AAAAh1BMVEX///8AAADu7u7t7e3z8/P6+vrs7Oz29vb7+"
> > }"
> > http::geturl "http://xxx.xxx.xxx.xxx/api/invofile" -query $data_string
> > headers [list Authorization "Bearer 3|xxxxxxxxxxx"] -timeout 10000000
> > -type application/json
> >
> > work in small size picture , less string
> > if the string as 1-2MB still hanging ... timeout no affect ...
> >
> >
> > as now , below code is the best way to work , but the hanging issue still not solved by add timeout ....
> > it's seem occupy the socket , no signal to let program already finish ....
> > set tok1 [::http::geturl "http://xxx.xxx.xxx.xxx/api/invofile" -query $http_str1 -headers [list Authorization "Bearer 3|xxxxxxxxx"]]
> >
> > do you have any ideal to conquer this , may by another way ..
> >
> > BR
> > Rolance
> >
> >
> In your php example, you used the 3rd party tool curt to send the data.
> The same tool is also available with TCL. It is called "tclcurl".
> This may help you. It may use advanced features not implemented in httpget.
>
> For the reason for the hang, I have no idea or experience.
> Sending big files by post is always critical and the base64 encodation
> makes it worse, due to its overhead (+3/2).
> AFAIK, there is a hard limit of 1MB * 2 / 3. But it should really not hang.
> A hang normally happens due to a not responding web server.
> So, a timeout is necessary to avoid this.
> A typical time is 2 Minuites, so 2*60*1000 = 180000. A "-timeout 180000"
> would be reasonable.
>
> Take care,
> Harald


Click here to read the complete article
Re: ::http::geturl long string issue

<te879o$n6$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=19955&group=comp.lang.tcl#19955

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!aioe.org!a5rWVvs5S5ZXUwkNcVnRMw.user.46.165.242.91.POSTED!not-for-mail
From: saitology9@gmail.com
Newsgroups: comp.lang.tcl
Subject: Re: ::http::geturl long string issue
Date: Thu, 25 Aug 2022 12:16:51 -0400
Organization: Aioe.org NNTP Server
Message-ID: <te879o$n6$1@gioia.aioe.org>
References: <54a3e3ae-2bb1-4b4d-80cb-8101d1703eb5n@googlegroups.com>
<te2h3n$301vc$1@dont-email.me>
<f5418446-1a42-493d-894b-d55186246fb8n@googlegroups.com>
<te2lfr$30fhn$1@dont-email.me>
<b8747314-e0f3-4a43-8cd5-550cbff8051cn@googlegroups.com>
<5f2d7e8c-21cd-4433-8224-fdc805a30693n@googlegroups.com>
<te5d0r$3bchb$1@dont-email.me>
<c343dc89-05f2-4120-808b-950bb6442ae8n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="742"; posting-host="a5rWVvs5S5ZXUwkNcVnRMw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.1.2
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: saitology9@gmail.com - Thu, 25 Aug 2022 16:16 UTC

On 8/24/22 4:10 PM, rola...@gmail.com wrote:
>
> thanks your example , to conquer long string issue. need to do further try handling issue
>
> the content is
>
> data is mass command or file (tranfer to base64 string)
>
>

Just to add the plethora of suggestions:

I wonder if your issue is on your local side where you convert the
program/file to base64. Have you checked for characters that might break
continuity like trailing trailing newlines, character sequences that
might be special to the server, etc.? Do you have a sense of what types
of "data" makes it stop working ?


devel / comp.lang.tcl / ::http::geturl long string issue

Pages:12
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor