Re: [twsocket] Posting

2013-01-06 Thread Stewart Obert
Hi,

I apologize. Figured it out. The problem was just that the URL didn't have a 
trailing slash and for whatever reason this created a problem. I added a 
trailing slash and it worked great.
 
Thank You,

Stewart Obert


cEdit Software: http://www.ceditmx.com/
Made to Color: http://www.madetocolor.com/

Phone: (888) 901 - 7977
Email Addresses:  acmpsoluti...@yahoo.com
Paypal: c...@myriad-industries.com



 From: Stewart Obert 
To: "twsocket@elists.org"  
Sent: Saturday, January 5, 2013 11:53 PM
Subject: [twsocket] Posting
 
Hi,

I was recently looking at ICS and considering it as a replacement for Indy for 
an application which works as an interface for a web application. I wanted to 
give it a quick try and see how it handles performing a simple login so I put 
this together using the code from the OverbyteIcsHttpPost project:



var
  stl: AnsiString;
begin

  try
    stl := 'Action=User&ToDo=Login&Username=' + 
UrlEncodeToA(Trim(act.Username)) +
         '&Password=' + UrlEncodeToA(Trim(act.Password));
    http.SendStream := TMemoryStream.Create;
    http.SendStream.Write(stl[1], Length(stl));
    http.SendStream.Seek(0, 0);

    http.RcvdStream := TMemoryStream.Create;
    http.URL := Trim(act.Domain);
    http.ContentTypePost := 'application/x-www-form-urlencoded';


    http.PostASync;
  except

  end;


The code wasn't succeeding since the web side was routing it to the default 
controller so I attempted listing all post data received and found it wasn't 
receiving post data. I know it must be a problem with my code, something I must 
have missed as when I tested the same server with the same post output using 
your sample post application it works fine but for the life of me I don't see 
where the difference lies. I'm hoping someone may see something I'm missing.
 
Thanks,

Stewart
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


[twsocket] Posting

2013-01-05 Thread Stewart Obert
Hi,

I was recently looking at ICS and considering it as a replacement for Indy for 
an application which works as an interface for a web application. I wanted to 
give it a quick try and see how it handles performing a simple login so I put 
this together using the code from the OverbyteIcsHttpPost project:



var
  stl: AnsiString;
begin

  try
    stl := 'Action=User&ToDo=Login&Username=' + 
UrlEncodeToA(Trim(act.Username)) +
         '&Password=' + UrlEncodeToA(Trim(act.Password));
    http.SendStream := TMemoryStream.Create;
    http.SendStream.Write(stl[1], Length(stl));
    http.SendStream.Seek(0, 0);

    http.RcvdStream := TMemoryStream.Create;
    http.URL := Trim(act.Domain);
    http.ContentTypePost := 'application/x-www-form-urlencoded';


    http.PostASync;
  except

  end;


The code wasn't succeeding since the web side was routing it to the default 
controller so I attempted listing all post data received and found it wasn't 
receiving post data. I know it must be a problem with my code, something I must 
have missed as when I tested the same server with the same post output using 
your sample post application it works fine but for the life of me I don't see 
where the difference lies. I'm hoping someone may see something I'm missing.
 
Thanks,

Stewart
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Posting unicode data in HTTP Post

2008-11-21 Thread Irfan Mulic
Hi,

Thanks for your help, but still I am not getting the same results when I do
post to php script.

This is PHP script

>  echo "Note = ". $_POST['note'];
>
> if($_POST['action'] == 'i')
>  {
>   /*
>   * This code will add new notes to the database
>   */
>   $sql = "INSERT INTO app_notes VALUES ('', '" .
> mysql_real_escape_string($_POST['username']) . "', '" .
> mysql_real_escape_string($_POST['note']) . "', NOW(), '')";
>   $result = mysql_query($sql, $link) or die('0 - Ins');
>   echo '1 - ' . mysql_insert_id($link);
> ?>
>
and this is the delphi code:
 data := Format('date=%s&username=%s&password=%s&hash=%s¬e=%s&action=%s',
[UrlEncode(FormatDateTime('mmddhh:nn',now)),
UrlEncode(edtUserName.Text),  UrlEncode(getMd5(edtPassword.Text)),
UrlEncode(getMd5(dataHash)),UrlEncode(Utf8Encode(memoNote.Text)),'i'  ]); //
try function StrHtmlEncode (const AStr: String): String; from IdStrings
HttpCli1.SendStream := TMemoryStream.Create;
HttpCli1.SendStream.Write(Data[1], Length(Data));
HttpCli1.SendStream.Seek(0, 0);  HttpCli1.RcvdStream :=
TMemoryStream.Create;  HttpCli1.URL := Trim(ActionURLEdit.Text);

  HttpCli1.PostAsync;


But the PHP script is getting totaly different characters ?
Any clue what this can be?
Thanks.
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Posting unicode data in HTTP Post

2008-11-20 Thread Arno Garrels
Irfan Mulic wrote:
> Yes it is Tnt Memo. I am using widestring from Tnt, I was thinking
> that Tnt is in utf-8?
> 
> Anywhay if I use urlencode on the character from Tnt Memo I am
> getting '?' as result.

That's easy to explain. UrlEncode takes a AnsiString, memoNote.Text 
is of type WideString. Assigning a WideString to a String causes
an implicit and silent conversion from WideString to AnsiString
which uses the default system code page. However if the WideString 
contained any character that cannot be converted to the current ANSI
code page those characters are replaced by question marks.

So UrlEncode(Utf8Encode(memoNote.Text)) should do the trick.

--
Arno Garrels [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html


  
> 
> What should solve my problems with posting from Tnt Memo using ICS?
> 
> On Thu, Nov 20, 2008 at 12:24 PM, Arno Garrels <[EMAIL PROTECTED]>
> wrote: 
> 
>> Irfan Mulic wrote:
>>> So this is ansiChar is not widechar this is all in range of ansi
>>> characters...
>> 
>> Why should one display UTF-8 strings in a AnsiString memo?
>> Anyway just to be sure, UTF-8 is a AnsiString (one byte element
>> size of the data array), WideString contains UTF-16 data with two
>> byte element size of the data array.
>> Question: Does memoNote.Text contain UTF-8 or UTF-16?
>> Maybe it's a TNT memo which contains WideStrings?
>> 
>> --
>> Arno Garrels [TeamICS]
>> http://www.overbyte.be/eng/overbyte/teamics.html
>> 
>> 
>>> 
>>> yes it is ICS issue, do you know is it fixed in newer versions?
>>> 
>>> On Thu, Nov 20, 2008 at 11:25 AM, Arno Garrels <[EMAIL PROTECTED]>
>>> wrote:
>>> 
 Irfan Mulic wrote:
> Hi,
> 
> Here is code:
> 
>  data :=
> Format('date=%s&username=%s&password=%s&hash=%s¬e=%s&action=%s',
>  [UrlEncode(FormatDateTime('mmddhh:nn',now)),
>  UrlEncode(edtUserName.Text),
>  UrlEncode(getMd5(edtPassword.Text)),
>  UrlEncode(getMd5(dataHash)),UrlEncode(memoNote.Text),'i'
>  ]);
 
 GetMD5() doesn't look like an ICS function since there is no
 overloaded GetMD5() in v5 that takes a string.
 
> 
> This memoNote.text is utf-8 this doesn't work with unicode
> characters?
 
 It works as URL encoding should work:
 Characters '0'..'9', 'A'..'Z', 'a'..'z' are left untouched,
 any Char outside these rages are encoded "'%' +
 IntToHex(Ord(AnsiChar))"
 
 It does not look like an ICS issue to me?
 
 --
 Arno Garrels [TeamICS]
 http://www.overbyte.be/eng/overbyte/teamics.html
 
 
 
> Is it fixed in new versions?
> 
>  HttpCli1.SendStream := TMemoryStream.Create;
>  HttpCli1.SendStream.Write(Data[1], Length(Data));
>  HttpCli1.SendStream.Seek(0, 0);
>  HttpCli1.RcvdStream := TMemoryStream.Create;
>  HttpCli1.URL := Trim(ActionURLEdit.Text);
>  HttpCli1.PostAsync;
> 
> Thanks.
> 
> Irfan
> On Thu, Nov 20, 2008 at 8:59 AM, Arno Garrels
> <[EMAIL PROTECTED]> wrote:
> 
>> Irfan Mulic wrote:
>>> I am using V5, first link on download page.
>> 
>> Ah, ok.
>> 
> I am having troubles to work with unicode data ?
>> 
>> What kind of problems do you have exactly? Can you show some
>> code? With POST you just write data to a stream which is send as
>> is. There is an example how to post multi-byte form data on the
>> User-Made page on ICS website.
>> 
>> --
>> Arno Garrels [TeamICS]
>> http://www.overbyte.be/eng/overbyte/teamics.html
>> 
>> 
>>> 
>>> On Thu, Nov 20, 2008 at 5:26 AM, Arno Garrels
>>> <[EMAIL PROTECTED]> wrote:
>>> 
 Irfan Mulic wrote:
> Hi,
> 
> I start using ICS components and I really like them.
 
 Which ICS version are yuo using?
 
 --
 Arno Garrels [TeamICS]
 http://www.overbyte.be/eng/overbyte/teamics.html
 
> 
> I am having troubles to work with unicode data ?
> 
> Can I get more info is this supported and can I get some
> examples of it.
> 
> I am using example httppost with Delphi 7.
> 
> Thank you.
> 
> 
> --
> Irfan Mulic
 --
 To unsubscribe or change your settings for TWSocket mailing
 list please goto
 http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit
 our website at http://www.overbyte.be
 
>>> 
>>> 
>>> 
>>> --
>>> Irfan Mulic
>> --
>> To unsubscribe or change your settings for TWSocket mailing list
>> please goto
>> http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit
>> our website at http://www.overbyte.be
>> 
> 
> 
> 
> --
> Irfan Mulic
 --
 To unsubscribe or change your settings for TWSocket mailing list
 please goto
 http://lists.elists.org/cgi-bin/mailman/

Re: [twsocket] Posting unicode data in HTTP Post

2008-11-20 Thread Irfan Mulic
Please advice me how to solve this issue correctly, for UI I don't have
anything except Tnt components in Delphi 7?
What is correct approach to this, I am preaty new with this unicode stuff
but I have to acomplish this task...
Thank you very much.
On Thu, Nov 20, 2008 at 12:46 PM, Irfan Mulic <[EMAIL PROTECTED]> wrote:

>
> Yes it is Tnt Memo. I am using widestring from Tnt, I was thinking that Tnt
> is in utf-8?
>
> Anywhay if I use urlencode on the character from Tnt Memo I am getting '?'
> as result.
>
> What should solve my problems with posting from Tnt Memo using ICS?
> On Thu, Nov 20, 2008 at 12:24 PM, Arno Garrels <[EMAIL PROTECTED]>wrote:
>
>> Irfan Mulic wrote:
>> > So this is ansiChar is not widechar this is all in range of ansi
>> > characters...
>>
>> Why should one display UTF-8 strings in a AnsiString memo?
>> Anyway just to be sure, UTF-8 is a AnsiString (one byte element
>> size of the data array), WideString contains UTF-16 data with two
>> byte element size of the data array.
>> Question: Does memoNote.Text contain UTF-8 or UTF-16?
>> Maybe it's a TNT memo which contains WideStrings?
>>
>> --
>> Arno Garrels [TeamICS]
>> http://www.overbyte.be/eng/overbyte/teamics.html
>>
>>
>> >
>> > yes it is ICS issue, do you know is it fixed in newer versions?
>> >
>> > On Thu, Nov 20, 2008 at 11:25 AM, Arno Garrels <[EMAIL PROTECTED]>
>> > wrote:
>> >
>> >> Irfan Mulic wrote:
>> >>> Hi,
>> >>>
>> >>> Here is code:
>> >>>
>> >>>  data :=
>> >>> Format('date=%s&username=%s&password=%s&hash=%s¬e=%s&action=%s',
>> >>>  [UrlEncode(FormatDateTime('mmddhh:nn',now)),
>> >>>  UrlEncode(edtUserName.Text),
>> >>>  UrlEncode(getMd5(edtPassword.Text)),
>> >>>  UrlEncode(getMd5(dataHash)),UrlEncode(memoNote.Text),'i'
>> >>>  ]);
>> >>
>> >> GetMD5() doesn't look like an ICS function since there is no
>> >> overloaded GetMD5() in v5 that takes a string.
>> >>
>> >>>
>> >>> This memoNote.text is utf-8 this doesn't work with unicode
>> >>> characters?
>> >>
>> >> It works as URL encoding should work:
>> >> Characters '0'..'9', 'A'..'Z', 'a'..'z' are left untouched,
>> >> any Char outside these rages are encoded "'%' +
>> >> IntToHex(Ord(AnsiChar))"
>> >>
>> >> It does not look like an ICS issue to me?
>> >>
>> >> --
>> >> Arno Garrels [TeamICS]
>> >> http://www.overbyte.be/eng/overbyte/teamics.html
>> >>
>> >>
>> >>
>> >>> Is it fixed in new versions?
>> >>>
>> >>>  HttpCli1.SendStream := TMemoryStream.Create;
>> >>>  HttpCli1.SendStream.Write(Data[1], Length(Data));
>> >>>  HttpCli1.SendStream.Seek(0, 0);
>> >>>  HttpCli1.RcvdStream := TMemoryStream.Create;
>> >>>  HttpCli1.URL := Trim(ActionURLEdit.Text);
>> >>>  HttpCli1.PostAsync;
>> >>>
>> >>> Thanks.
>> >>>
>> >>> Irfan
>> >>> On Thu, Nov 20, 2008 at 8:59 AM, Arno Garrels <[EMAIL PROTECTED]>
>> >>> wrote:
>> >>>
>>  Irfan Mulic wrote:
>> > I am using V5, first link on download page.
>> 
>>  Ah, ok.
>> 
>> >>> I am having troubles to work with unicode data ?
>> 
>>  What kind of problems do you have exactly? Can you show some code?
>>  With POST you just write data to a stream which is send as is.
>>  There is an example how to post multi-byte form data on the
>>  User-Made page on ICS website.
>> 
>>  --
>>  Arno Garrels [TeamICS]
>>  http://www.overbyte.be/eng/overbyte/teamics.html
>> 
>> 
>> >
>> > On Thu, Nov 20, 2008 at 5:26 AM, Arno Garrels
>> > <[EMAIL PROTECTED]> wrote:
>> >
>> >> Irfan Mulic wrote:
>> >>> Hi,
>> >>>
>> >>> I start using ICS components and I really like them.
>> >>
>> >> Which ICS version are yuo using?
>> >>
>> >> --
>> >> Arno Garrels [TeamICS]
>> >> http://www.overbyte.be/eng/overbyte/teamics.html
>> >>
>> >>>
>> >>> I am having troubles to work with unicode data ?
>> >>>
>> >>> Can I get more info is this supported and can I get some
>> >>> examples of it.
>> >>>
>> >>> I am using example httppost with Delphi 7.
>> >>>
>> >>> Thank you.
>> >>>
>> >>>
>> >>> --
>> >>> Irfan Mulic
>> >> --
>> >> To unsubscribe or change your settings for TWSocket mailing list
>> >> please goto
>> >> http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit
>> >> our website at http://www.overbyte.be
>> >>
>> >
>> >
>> >
>> > --
>> > Irfan Mulic
>>  --
>>  To unsubscribe or change your settings for TWSocket mailing list
>>  please goto
>>  http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit
>>  our website at http://www.overbyte.be
>> 
>> >>>
>> >>>
>> >>>
>> >>> --
>> >>> Irfan Mulic
>> >> --
>> >> To unsubscribe or change your settings for TWSocket mailing list
>> >> please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
>> >> Visit our website at http://www.overbyte.be
>> >>
>> >
>> >
>> >
>> > --
>> > Irfan Mulic
>> --
>> To unsubscribe or change your settings for TWSo

Re: [twsocket] Posting unicode data in HTTP Post

2008-11-20 Thread Irfan Mulic
Yes it is Tnt Memo. I am using widestring from Tnt, I was thinking that Tnt
is in utf-8?

Anywhay if I use urlencode on the character from Tnt Memo I am getting '?'
as result.

What should solve my problems with posting from Tnt Memo using ICS?

On Thu, Nov 20, 2008 at 12:24 PM, Arno Garrels <[EMAIL PROTECTED]> wrote:

> Irfan Mulic wrote:
> > So this is ansiChar is not widechar this is all in range of ansi
> > characters...
>
> Why should one display UTF-8 strings in a AnsiString memo?
> Anyway just to be sure, UTF-8 is a AnsiString (one byte element
> size of the data array), WideString contains UTF-16 data with two
> byte element size of the data array.
> Question: Does memoNote.Text contain UTF-8 or UTF-16?
> Maybe it's a TNT memo which contains WideStrings?
>
> --
> Arno Garrels [TeamICS]
> http://www.overbyte.be/eng/overbyte/teamics.html
>
>
> >
> > yes it is ICS issue, do you know is it fixed in newer versions?
> >
> > On Thu, Nov 20, 2008 at 11:25 AM, Arno Garrels <[EMAIL PROTECTED]>
> > wrote:
> >
> >> Irfan Mulic wrote:
> >>> Hi,
> >>>
> >>> Here is code:
> >>>
> >>>  data :=
> >>> Format('date=%s&username=%s&password=%s&hash=%s¬e=%s&action=%s',
> >>>  [UrlEncode(FormatDateTime('mmddhh:nn',now)),
> >>>  UrlEncode(edtUserName.Text),
> >>>  UrlEncode(getMd5(edtPassword.Text)),
> >>>  UrlEncode(getMd5(dataHash)),UrlEncode(memoNote.Text),'i'
> >>>  ]);
> >>
> >> GetMD5() doesn't look like an ICS function since there is no
> >> overloaded GetMD5() in v5 that takes a string.
> >>
> >>>
> >>> This memoNote.text is utf-8 this doesn't work with unicode
> >>> characters?
> >>
> >> It works as URL encoding should work:
> >> Characters '0'..'9', 'A'..'Z', 'a'..'z' are left untouched,
> >> any Char outside these rages are encoded "'%' +
> >> IntToHex(Ord(AnsiChar))"
> >>
> >> It does not look like an ICS issue to me?
> >>
> >> --
> >> Arno Garrels [TeamICS]
> >> http://www.overbyte.be/eng/overbyte/teamics.html
> >>
> >>
> >>
> >>> Is it fixed in new versions?
> >>>
> >>>  HttpCli1.SendStream := TMemoryStream.Create;
> >>>  HttpCli1.SendStream.Write(Data[1], Length(Data));
> >>>  HttpCli1.SendStream.Seek(0, 0);
> >>>  HttpCli1.RcvdStream := TMemoryStream.Create;
> >>>  HttpCli1.URL := Trim(ActionURLEdit.Text);
> >>>  HttpCli1.PostAsync;
> >>>
> >>> Thanks.
> >>>
> >>> Irfan
> >>> On Thu, Nov 20, 2008 at 8:59 AM, Arno Garrels <[EMAIL PROTECTED]>
> >>> wrote:
> >>>
>  Irfan Mulic wrote:
> > I am using V5, first link on download page.
> 
>  Ah, ok.
> 
> >>> I am having troubles to work with unicode data ?
> 
>  What kind of problems do you have exactly? Can you show some code?
>  With POST you just write data to a stream which is send as is.
>  There is an example how to post multi-byte form data on the
>  User-Made page on ICS website.
> 
>  --
>  Arno Garrels [TeamICS]
>  http://www.overbyte.be/eng/overbyte/teamics.html
> 
> 
> >
> > On Thu, Nov 20, 2008 at 5:26 AM, Arno Garrels
> > <[EMAIL PROTECTED]> wrote:
> >
> >> Irfan Mulic wrote:
> >>> Hi,
> >>>
> >>> I start using ICS components and I really like them.
> >>
> >> Which ICS version are yuo using?
> >>
> >> --
> >> Arno Garrels [TeamICS]
> >> http://www.overbyte.be/eng/overbyte/teamics.html
> >>
> >>>
> >>> I am having troubles to work with unicode data ?
> >>>
> >>> Can I get more info is this supported and can I get some
> >>> examples of it.
> >>>
> >>> I am using example httppost with Delphi 7.
> >>>
> >>> Thank you.
> >>>
> >>>
> >>> --
> >>> Irfan Mulic
> >> --
> >> To unsubscribe or change your settings for TWSocket mailing list
> >> please goto
> >> http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit
> >> our website at http://www.overbyte.be
> >>
> >
> >
> >
> > --
> > Irfan Mulic
>  --
>  To unsubscribe or change your settings for TWSocket mailing list
>  please goto
>  http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit
>  our website at http://www.overbyte.be
> 
> >>>
> >>>
> >>>
> >>> --
> >>> Irfan Mulic
> >> --
> >> To unsubscribe or change your settings for TWSocket mailing list
> >> please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
> >> Visit our website at http://www.overbyte.be
> >>
> >
> >
> >
> > --
> > Irfan Mulic
> --
> To unsubscribe or change your settings for TWSocket mailing list
> please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
> Visit our website at http://www.overbyte.be
>



-- 
Irfan Mulic
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Posting unicode data in HTTP Post

2008-11-20 Thread Arno Garrels
Irfan Mulic wrote:
> So this is ansiChar is not widechar this is all in range of ansi
> characters...

Why should one display UTF-8 strings in a AnsiString memo?
Anyway just to be sure, UTF-8 is a AnsiString (one byte element 
size of the data array), WideString contains UTF-16 data with two 
byte element size of the data array.
Question: Does memoNote.Text contain UTF-8 or UTF-16?
Maybe it's a TNT memo which contains WideStrings?  

--
Arno Garrels [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html


> 
> yes it is ICS issue, do you know is it fixed in newer versions?
> 
> On Thu, Nov 20, 2008 at 11:25 AM, Arno Garrels <[EMAIL PROTECTED]>
> wrote: 
> 
>> Irfan Mulic wrote:
>>> Hi,
>>> 
>>> Here is code:
>>> 
>>>  data :=
>>> Format('date=%s&username=%s&password=%s&hash=%s¬e=%s&action=%s',
>>>  [UrlEncode(FormatDateTime('mmddhh:nn',now)),
>>>  UrlEncode(edtUserName.Text),
>>>  UrlEncode(getMd5(edtPassword.Text)),
>>>  UrlEncode(getMd5(dataHash)),UrlEncode(memoNote.Text),'i'
>>>  ]);
>> 
>> GetMD5() doesn't look like an ICS function since there is no
>> overloaded GetMD5() in v5 that takes a string.
>> 
>>> 
>>> This memoNote.text is utf-8 this doesn't work with unicode
>>> characters?
>> 
>> It works as URL encoding should work:
>> Characters '0'..'9', 'A'..'Z', 'a'..'z' are left untouched,
>> any Char outside these rages are encoded "'%' +
>> IntToHex(Ord(AnsiChar))" 
>> 
>> It does not look like an ICS issue to me?
>> 
>> --
>> Arno Garrels [TeamICS]
>> http://www.overbyte.be/eng/overbyte/teamics.html
>> 
>> 
>> 
>>> Is it fixed in new versions?
>>> 
>>>  HttpCli1.SendStream := TMemoryStream.Create;
>>>  HttpCli1.SendStream.Write(Data[1], Length(Data));
>>>  HttpCli1.SendStream.Seek(0, 0);
>>>  HttpCli1.RcvdStream := TMemoryStream.Create;
>>>  HttpCli1.URL := Trim(ActionURLEdit.Text);
>>>  HttpCli1.PostAsync;
>>> 
>>> Thanks.
>>> 
>>> Irfan
>>> On Thu, Nov 20, 2008 at 8:59 AM, Arno Garrels <[EMAIL PROTECTED]>
>>> wrote:
>>> 
 Irfan Mulic wrote:
> I am using V5, first link on download page.
 
 Ah, ok.
 
>>> I am having troubles to work with unicode data ?
 
 What kind of problems do you have exactly? Can you show some code?
 With POST you just write data to a stream which is send as is.
 There is an example how to post multi-byte form data on the
 User-Made page on ICS website.
 
 --
 Arno Garrels [TeamICS]
 http://www.overbyte.be/eng/overbyte/teamics.html
 
 
> 
> On Thu, Nov 20, 2008 at 5:26 AM, Arno Garrels
> <[EMAIL PROTECTED]> wrote:
> 
>> Irfan Mulic wrote:
>>> Hi,
>>> 
>>> I start using ICS components and I really like them.
>> 
>> Which ICS version are yuo using?
>> 
>> --
>> Arno Garrels [TeamICS]
>> http://www.overbyte.be/eng/overbyte/teamics.html
>> 
>>> 
>>> I am having troubles to work with unicode data ?
>>> 
>>> Can I get more info is this supported and can I get some
>>> examples of it.
>>> 
>>> I am using example httppost with Delphi 7.
>>> 
>>> Thank you.
>>> 
>>> 
>>> --
>>> Irfan Mulic
>> --
>> To unsubscribe or change your settings for TWSocket mailing list
>> please goto
>> http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit
>> our website at http://www.overbyte.be
>> 
> 
> 
> 
> --
> Irfan Mulic
 --
 To unsubscribe or change your settings for TWSocket mailing list
 please goto
 http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit
 our website at http://www.overbyte.be 
 
>>> 
>>> 
>>> 
>>> --
>>> Irfan Mulic
>> --
>> To unsubscribe or change your settings for TWSocket mailing list
>> please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
>> Visit our website at http://www.overbyte.be
>> 
> 
> 
> 
> --
> Irfan Mulic
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Posting unicode data in HTTP Post

2008-11-20 Thread Irfan Mulic
So this is ansiChar is not widechar this is all in range of ansi
characters...

yes it is ICS issue, do you know is it fixed in newer versions?

On Thu, Nov 20, 2008 at 11:25 AM, Arno Garrels <[EMAIL PROTECTED]> wrote:

> Irfan Mulic wrote:
> > Hi,
> >
> > Here is code:
> >
> >  data :=
> > Format('date=%s&username=%s&password=%s&hash=%s¬e=%s&action=%s',
> >  [UrlEncode(FormatDateTime('mmddhh:nn',now)),
> >  UrlEncode(edtUserName.Text),
> >  UrlEncode(getMd5(edtPassword.Text)),
> >  UrlEncode(getMd5(dataHash)),UrlEncode(memoNote.Text),'i'
> >  ]);
>
> GetMD5() doesn't look like an ICS function since there is no overloaded
> GetMD5() in v5 that takes a string.
>
> >
> > This memoNote.text is utf-8 this doesn't work with unicode
> > characters?
>
> It works as URL encoding should work:
> Characters '0'..'9', 'A'..'Z', 'a'..'z' are left untouched,
> any Char outside these rages are encoded "'%' + IntToHex(Ord(AnsiChar))"
>
> It does not look like an ICS issue to me?
>
> --
> Arno Garrels [TeamICS]
> http://www.overbyte.be/eng/overbyte/teamics.html
>
>
>
> > Is it fixed in new versions?
> >
> >  HttpCli1.SendStream := TMemoryStream.Create;
> >  HttpCli1.SendStream.Write(Data[1], Length(Data));
> >  HttpCli1.SendStream.Seek(0, 0);
> >  HttpCli1.RcvdStream := TMemoryStream.Create;
> >  HttpCli1.URL := Trim(ActionURLEdit.Text);
> >  HttpCli1.PostAsync;
> >
> > Thanks.
> >
> > Irfan
> > On Thu, Nov 20, 2008 at 8:59 AM, Arno Garrels <[EMAIL PROTECTED]>
> > wrote:
> >
> >> Irfan Mulic wrote:
> >>> I am using V5, first link on download page.
> >>
> >> Ah, ok.
> >>
> > I am having troubles to work with unicode data ?
> >>
> >> What kind of problems do you have exactly? Can you show some code?
> >> With POST you just write data to a stream which is send as is.
> >> There is an example how to post multi-byte form data on the
> >> User-Made page on ICS website.
> >>
> >> --
> >> Arno Garrels [TeamICS]
> >> http://www.overbyte.be/eng/overbyte/teamics.html
> >>
> >>
> >>>
> >>> On Thu, Nov 20, 2008 at 5:26 AM, Arno Garrels <[EMAIL PROTECTED]>
> >>> wrote:
> >>>
>  Irfan Mulic wrote:
> > Hi,
> >
> > I start using ICS components and I really like them.
> 
>  Which ICS version are yuo using?
> 
>  --
>  Arno Garrels [TeamICS]
>  http://www.overbyte.be/eng/overbyte/teamics.html
> 
> >
> > I am having troubles to work with unicode data ?
> >
> > Can I get more info is this supported and can I get some examples
> > of it.
> >
> > I am using example httppost with Delphi 7.
> >
> > Thank you.
> >
> >
> > --
> > Irfan Mulic
>  --
>  To unsubscribe or change your settings for TWSocket mailing list
>  please goto
>  http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit
>  our website at http://www.overbyte.be
> 
> >>>
> >>>
> >>>
> >>> --
> >>> Irfan Mulic
> >> --
> >> To unsubscribe or change your settings for TWSocket mailing list
> >> please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
> >> Visit our website at http://www.overbyte.be
> >>
> >
> >
> >
> > --
> > Irfan Mulic
> --
> To unsubscribe or change your settings for TWSocket mailing list
> please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
> Visit our website at http://www.overbyte.be
>



-- 
Irfan Mulic
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Posting unicode data in HTTP Post

2008-11-20 Thread Arno Garrels
Irfan Mulic wrote:
> Hi,
> 
> Here is code:
> 
>  data :=
> Format('date=%s&username=%s&password=%s&hash=%s¬e=%s&action=%s',
>  [UrlEncode(FormatDateTime('mmddhh:nn',now)),
>  UrlEncode(edtUserName.Text),
>  UrlEncode(getMd5(edtPassword.Text)),
>  UrlEncode(getMd5(dataHash)),UrlEncode(memoNote.Text),'i'
>  ]);

GetMD5() doesn't look like an ICS function since there is no overloaded
GetMD5() in v5 that takes a string.

> 
> This memoNote.text is utf-8 this doesn't work with unicode
> characters? 

It works as URL encoding should work:
Characters '0'..'9', 'A'..'Z', 'a'..'z' are left untouched,
any Char outside these rages are encoded "'%' + IntToHex(Ord(AnsiChar))"

It does not look like an ICS issue to me?

--
Arno Garrels [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html

  

> Is it fixed in new versions?
> 
>  HttpCli1.SendStream := TMemoryStream.Create;
>  HttpCli1.SendStream.Write(Data[1], Length(Data));
>  HttpCli1.SendStream.Seek(0, 0);
>  HttpCli1.RcvdStream := TMemoryStream.Create;
>  HttpCli1.URL := Trim(ActionURLEdit.Text);
>  HttpCli1.PostAsync;
> 
> Thanks.
> 
> Irfan
> On Thu, Nov 20, 2008 at 8:59 AM, Arno Garrels <[EMAIL PROTECTED]>
> wrote: 
> 
>> Irfan Mulic wrote:
>>> I am using V5, first link on download page.
>> 
>> Ah, ok.
>> 
> I am having troubles to work with unicode data ?
>> 
>> What kind of problems do you have exactly? Can you show some code?
>> With POST you just write data to a stream which is send as is.
>> There is an example how to post multi-byte form data on the
>> User-Made page on ICS website.
>> 
>> --
>> Arno Garrels [TeamICS]
>> http://www.overbyte.be/eng/overbyte/teamics.html
>> 
>> 
>>> 
>>> On Thu, Nov 20, 2008 at 5:26 AM, Arno Garrels <[EMAIL PROTECTED]>
>>> wrote:
>>> 
 Irfan Mulic wrote:
> Hi,
> 
> I start using ICS components and I really like them.
 
 Which ICS version are yuo using?
 
 --
 Arno Garrels [TeamICS]
 http://www.overbyte.be/eng/overbyte/teamics.html
 
> 
> I am having troubles to work with unicode data ?
> 
> Can I get more info is this supported and can I get some examples
> of it.
> 
> I am using example httppost with Delphi 7.
> 
> Thank you.
> 
> 
> --
> Irfan Mulic
 --
 To unsubscribe or change your settings for TWSocket mailing list
 please goto
 http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit
 our website at http://www.overbyte.be 
 
>>> 
>>> 
>>> 
>>> --
>>> Irfan Mulic
>> --
>> To unsubscribe or change your settings for TWSocket mailing list
>> please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
>> Visit our website at http://www.overbyte.be
>> 
> 
> 
> 
> --
> Irfan Mulic
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Posting unicode data in HTTP Post

2008-11-20 Thread Irfan Mulic
Hi,

Here is code:

  data :=
Format('date=%s&username=%s&password=%s&hash=%s¬e=%s&action=%s',
  [UrlEncode(FormatDateTime('mmddhh:nn',now)),
  UrlEncode(edtUserName.Text),
  UrlEncode(getMd5(edtPassword.Text)),
  UrlEncode(getMd5(dataHash)),UrlEncode(memoNote.Text),'i'
  ]);

This memoNote.text is utf-8 this doesn't work with unicode characters? Is it
fixed in new versions?

  HttpCli1.SendStream := TMemoryStream.Create;
  HttpCli1.SendStream.Write(Data[1], Length(Data));
  HttpCli1.SendStream.Seek(0, 0);
  HttpCli1.RcvdStream := TMemoryStream.Create;
  HttpCli1.URL := Trim(ActionURLEdit.Text);
  HttpCli1.PostAsync;

Thanks.

Irfan
On Thu, Nov 20, 2008 at 8:59 AM, Arno Garrels <[EMAIL PROTECTED]> wrote:

> Irfan Mulic wrote:
> > I am using V5, first link on download page.
>
> Ah, ok.
>
> >>> I am having troubles to work with unicode data ?
>
> What kind of problems do you have exactly? Can you show some code?
> With POST you just write data to a stream which is send as is.
> There is an example how to post multi-byte form data on the
> User-Made page on ICS website.
>
> --
> Arno Garrels [TeamICS]
> http://www.overbyte.be/eng/overbyte/teamics.html
>
>
> >
> > On Thu, Nov 20, 2008 at 5:26 AM, Arno Garrels <[EMAIL PROTECTED]>
> > wrote:
> >
> >> Irfan Mulic wrote:
> >>> Hi,
> >>>
> >>> I start using ICS components and I really like them.
> >>
> >> Which ICS version are yuo using?
> >>
> >> --
> >> Arno Garrels [TeamICS]
> >> http://www.overbyte.be/eng/overbyte/teamics.html
> >>
> >>>
> >>> I am having troubles to work with unicode data ?
> >>>
> >>> Can I get more info is this supported and can I get some examples of
> >>> it.
> >>>
> >>> I am using example httppost with Delphi 7.
> >>>
> >>> Thank you.
> >>>
> >>>
> >>> --
> >>> Irfan Mulic
> >> --
> >> To unsubscribe or change your settings for TWSocket mailing list
> >> please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
> >> Visit our website at http://www.overbyte.be
> >>
> >
> >
> >
> > --
> > Irfan Mulic
> --
> To unsubscribe or change your settings for TWSocket mailing list
> please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
> Visit our website at http://www.overbyte.be
>



-- 
Irfan Mulic
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Posting unicode data in HTTP Post

2008-11-20 Thread Arno Garrels
Irfan Mulic wrote:
> I am using V5, first link on download page.

Ah, ok. 

>>> I am having troubles to work with unicode data ?

What kind of problems do you have exactly? Can you show some code?
With POST you just write data to a stream which is send as is. 
There is an example how to post multi-byte form data on the 
User-Made page on ICS website. 

--
Arno Garrels [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html


> 
> On Thu, Nov 20, 2008 at 5:26 AM, Arno Garrels <[EMAIL PROTECTED]>
> wrote: 
> 
>> Irfan Mulic wrote:
>>> Hi,
>>> 
>>> I start using ICS components and I really like them.
>> 
>> Which ICS version are yuo using?
>> 
>> --
>> Arno Garrels [TeamICS]
>> http://www.overbyte.be/eng/overbyte/teamics.html
>> 
>>> 
>>> I am having troubles to work with unicode data ?
>>> 
>>> Can I get more info is this supported and can I get some examples of
>>> it.
>>> 
>>> I am using example httppost with Delphi 7.
>>> 
>>> Thank you.
>>> 
>>> 
>>> --
>>> Irfan Mulic
>> --
>> To unsubscribe or change your settings for TWSocket mailing list
>> please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
>> Visit our website at http://www.overbyte.be
>> 
> 
> 
> 
> --
> Irfan Mulic
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Posting unicode data in HTTP Post

2008-11-20 Thread Irfan Mulic
I am using V5, first link on download page.

On Thu, Nov 20, 2008 at 5:26 AM, Arno Garrels <[EMAIL PROTECTED]> wrote:

> Irfan Mulic wrote:
> > Hi,
> >
> > I start using ICS components and I really like them.
>
> Which ICS version are yuo using?
>
> --
> Arno Garrels [TeamICS]
> http://www.overbyte.be/eng/overbyte/teamics.html
>
> >
> > I am having troubles to work with unicode data ?
> >
> > Can I get more info is this supported and can I get some examples of
> > it.
> >
> > I am using example httppost with Delphi 7.
> >
> > Thank you.
> >
> >
> > --
> > Irfan Mulic
> --
> To unsubscribe or change your settings for TWSocket mailing list
> please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
> Visit our website at http://www.overbyte.be
>



-- 
Irfan Mulic
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Posting unicode data in HTTP Post

2008-11-20 Thread Arno Garrels
Irfan Mulic wrote:
> Hi,
> 
> I start using ICS components and I really like them.

Which ICS version are yuo using?

--
Arno Garrels [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html

> 
> I am having troubles to work with unicode data ?
> 
> Can I get more info is this supported and can I get some examples of
> it. 
> 
> I am using example httppost with Delphi 7.
> 
> Thank you.
> 
> 
> --
> Irfan Mulic
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


[twsocket] Posting unicode data in HTTP Post

2008-11-20 Thread Irfan Mulic
Hi,

I start using ICS components and I really like them.

I am having troubles to work with unicode data ?

Can I get more info is this supported and can I get some examples of it.

I am using example httppost with Delphi 7.

Thank you.


-- 
Irfan Mulic
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Posting datatoweb serverusing THttpCliunder usercontrol

2006-11-22 Thread Clay Shannon
<<> Do you see any wholes in my logic?

I don't.>>

Partials?

The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material.  If the reader of this message is not the intended recipient,
you are hereby notified that your access is unauthorized, and any review,
dissemination, distribution or copying of this message including any
attachments is strictly prohibited.   If you are not the intended
recipient, please contact the sender and delete the material from any
computer.
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Re: [twsocket] Posting data toweb serverusing THttpCliunder usercontrol

2006-11-22 Thread Francois Piette
> Do you see any wholes in my logic?

I don't.

Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
Author of ICS (Internet Component Suite, freeware)
Author of MidWare (Multi-tier framework, freeware)
http://www.overbyte.be


- Original Message - 
From: "Cosmin Prund" <[EMAIL PROTECTED]>
To: "ICS support mailing" 
Sent: Wednesday, November 22, 2006 2:20 PM
Subject: Re: [twsocket] Posting data toweb serverusing THttpCliunder
usercontrol


> Francois Piette wrote:
> > This is proxy implementation dependent. The proxy could buffer the
document
> > up to some point and then give up and forward everything. It could also
> > handle document differently according to the content-type.
> >
> > If you consider this would not happend, then it's OK for me. I'm just
giving
> > you the ideas I have :-)
> >
> >
>
> Thanks for the input, it's good to know how things might fail :)
>
> For my "downstream" connection I'll use the following logic (when proxy
> is enabled):
> (a) Try CONNECT; If it fails go to (b)
> (b) Start my standard HTTP Wizardry; At the first NOP received send an
> "ACK" to the server, letting it know I actually got the message. If the
> server has a "real" message to send (ie: not a NOP) and it hasn't
> received any NOP-confirmation yet, I'll send the message and then close
> the connection. If the server has already received an ACK for a NOP when
> it needs to send the real message (and the ACK was received in a timely
> manner) I'll know the proxy is relaying all sent data in a timely manner
> and I'll send the "real" message without closing the connection.
>
> In my opinion this should work, no matter how the server is configured.
> It should also work if I'm dealing with an transparent proxy (so I don't
> actually know I'm dealing with a proxy). Do you see any wholes in my
logic?
>
> Unfortunately for my "upstream" connection I only have two options: use
> CONNECT or use successive POST's; The "successive POSTs" variant doesn't
> sound all that good, since I also want to "tunnel" interactive traffic
> through the HTTP proxy (interactive=VNC, not plain-old chat; Chat would
> pose no problem)
>
> Thanks,
> Cosmin Prund
> -- 
> To unsubscribe or change your settings for TWSocket mailing list
> please goto http://www.elists.org/mailman/listinfo/twsocket
> Visit our website at http://www.overbyte.be

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Posting data to web serverusing THttpCliunder usercontrol

2006-11-22 Thread Cosmin Prund
Francois Piette wrote:
> This is proxy implementation dependent. The proxy could buffer the document
> up to some point and then give up and forward everything. It could also
> handle document differently according to the content-type.
>
> If you consider this would not happend, then it's OK for me. I'm just giving
> you the ideas I have :-)
>
>   

Thanks for the input, it's good to know how things might fail :)

For my "downstream" connection I'll use the following logic (when proxy 
is enabled):
(a) Try CONNECT; If it fails go to (b)
(b) Start my standard HTTP Wizardry; At the first NOP received send an 
"ACK" to the server, letting it know I actually got the message. If the 
server has a "real" message to send (ie: not a NOP) and it hasn't 
received any NOP-confirmation yet, I'll send the message and then close 
the connection. If the server has already received an ACK for a NOP when 
it needs to send the real message (and the ACK was received in a timely 
manner) I'll know the proxy is relaying all sent data in a timely manner 
and I'll send the "real" message without closing the connection.

In my opinion this should work, no matter how the server is configured. 
It should also work if I'm dealing with an transparent proxy (so I don't 
actually know I'm dealing with a proxy). Do you see any wholes in my logic?

Unfortunately for my "upstream" connection I only have two options: use 
CONNECT or use successive POST's; The "successive POSTs" variant doesn't 
sound all that good, since I also want to "tunnel" interactive traffic 
through the HTTP proxy (interactive=VNC, not plain-old chat; Chat would 
pose no problem)

Thanks,
Cosmin Prund
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Posting data to web serverusing THttpCliunder usercontrol

2006-11-22 Thread Francois Piette
> I'll re-explain how my downstream (that is - HTTP
> download) connection works. The client requests a document from my web
> server. It does this going through the proxy. The server response (200
> OK), does NOT send an Content-length header and starts sending the
> document very very slowly, but it keeps sending for ever. It looks just
> like a large file download over a very slow link. Since there's no
> Content-length header the proxy is unable to determine if the document
> has finished downloading or not, it will keep receiving the given
> document for as long as the server sends. I noticed the proxy does one
> other nice thing: it immediately relays all received data to the client,
> and it really makes sense.

Immedaite relay is NOT mandatory. The proxy could as well grab the complete
document, process it's content and then forward it. In that case your
software would not work.

> Real-life example that should force the proxy to behave in this very
> same manner: The client is downloading a 4Gb ISO image through the
> proxy. The proxy can't possibly wait for the WHOLE download to finish
> before starting to relay data to the client, it just doesn't make sense.
> It must start sending data to the client as soon as data is available.

This is proxy implementation dependent. The proxy could buffer the document
up to some point and then give up and forward everything. It could also
handle document differently according to the content-type.

If you consider this would not happend, then it's OK for me. I'm just giving
you the ideas I have :-)

> I might try implementing this as well. Trying an CONNECT first and, if
> that doesn't work, fall-back to alternative, slower methods.
> Can the THttpCli component be used for proxy CONNECT only, bypassing
> everything else?

THttpCli, SSL enabled use CONNECT method (This is mandatory for HTTPS !). If
you have ICS-SSL, you may have a look at how it is implemented. At first
glance it is not too difficult to implement also for non-ssl part of the
component. You are welcome to do it of course.

> Or should I start with a vanilla TWSocket and work my  way from that?

There is someone having implemented HTTP proxy traversal into TWSocket. I'm
in touch with him to make his code available in the official release. There
is still some work to do so it will not be available before some time (maybe
months !). Contact me privately if you want his email.


Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
Author of ICS (Internet Component Suite, freeware)
Author of MidWare (Multi-tier framework, freeware)
http://www.overbyte.be

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Posting data to web server using THttpCliunder usercontrol

2006-11-22 Thread Cosmin Prund
Francois PIETTE wrote:
>> Using hgWillSendMySelf I noticed the proxy server immediately connects
>> the client to the server and the connection is kept open as long as I'm
>> sending data. If the proxy server does the same for the "long HTTP post"
>> it would provide a very valuable tool for what I need.
>> 
>
> I wouldn't base my software on this behaviour which is defenitely not 
> guaranteed. HTTP protocol is a stateless protocol and you have poor 
> connection control. Just ask for the connection to be kept alive and hope it 
> is. If it isn't, then it will be reopened anyway by the component.
>
>
>   
None of the things I'm doing expects the HTTP protocol to be anything 
but stateless. I'll re-explain how my downstream (that is - HTTP 
download) connection works. The client requests a document from my web 
server. It does this going through the proxy. The server response (200 
OK), does NOT send an Content-length header and starts sending the 
document very very slowly, but it keeps sending for ever. It looks just 
like a large file download over a very slow link. Since there's no 
Content-length header the proxy is unable to determine if the document 
has finished downloading or not, it will keep receiving the given 
document for as long as the server sends. I noticed the proxy does one 
other nice thing: it immediately relays all received data to the client, 
and it really makes sense.

Real-life example that should force the proxy to behave in this very 
same manner: The client is downloading a 4Gb ISO image through the 
proxy. The proxy can't possibly wait for the WHOLE download to finish 
before starting to relay data to the client, it just doesn't make sense. 
It must start sending data to the client as soon as data is available.

What I'm thinking about is using the very same thing the other way 
around: Doing a slow POST! I do understand downloading and uploading are 
governed by different rules, so I'd like to try this too. If you still 
say it's unlikely to work, I'll stop trying (by now I'm sure I explained 
things clearly enough so there's no misunderstanding).
>> On a different note, how do programs like "zebedee" provide a TCP/IP
>> tunnel through a HTTP proxy? I understand how the "downstream" part
>> works, but how about the "upstream" part?
>> 
>
> This is quite easy. You can send the command "CONNECT" to a HTTP proxy and 
> then the proxy will work transparently as a simple relay, without ever 
> trying to understand what you send in the stream. This is how HTTPS works 
> thru the proxy. Since HTTPS encrypt everything, the proxy is unable to do 
> anything. It can just relay the data. That's the purpose of the "CONNECT" 
> command.
>   

I might try implementing this as well. Trying an CONNECT first and, if 
that doesn't work, fall-back to alternative, slower methods.
Can the THttpCli component be used for proxy CONNECT only, bypassing 
everything else? Or should I start with a vanilla TWSocket and work my 
way from that?

Thanks,
Cosmin Prund
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Posting data to web server using THttpCli under usercontrol

2006-11-21 Thread Cosmin Prund
Francois Piette wrote:
>> I'm using THttpServer to send a document myself (using hgWillSendMySelf)
>> so I can keep sending new data without requiring a new connection. It
>> works just fine. Now I want to do the same the other way around: I want
>> to use THttpCli to continually "post" data, without closing the
>> 
> connection.
>
> You can have a HTTP post which never ends. But probably it is not what you
> really want. Since you control the client part, why not send as many HTTP
> requests as you need ?
>
>   

Using hgWillSendMySelf I noticed the proxy server immediately connects 
the client to the server and the connection is kept open as long as I'm 
sending data. If the proxy server does the same for the "long HTTP post" 
it would provide a very valuable tool for what I need. If it doesn't 
work I'll simply use as many HTTP posts as necessary. And if it makes 
any difference, for this part of my application I control both the 
"client" and the "server"; It's the potential proxy in the middle I'm 
not controlling. I need to use HTTP to make sure it works through the proxy.

On a different note, how do programs like "zebedee" provide a TCP/IP 
tunnel through a HTTP proxy? I understand how the "downstream" part 
works, but how about the "upstream" part?

Thanks,
Cosmin Prund
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Posting data to web server using THttpCliunder usercontrol

2006-11-21 Thread Francois PIETTE
> Using hgWillSendMySelf I noticed the proxy server immediately connects
> the client to the server and the connection is kept open as long as I'm
> sending data. If the proxy server does the same for the "long HTTP post"
> it would provide a very valuable tool for what I need.

I wouldn't base my software on this behaviour which is defenitely not 
guaranteed. HTTP protocol is a stateless protocol and you have poor 
connection control. Just ask for the connection to be kept alive and hope it 
is. If it isn't, then it will be reopened anyway by the component.


> If it doesn't work I'll simply use as many HTTP posts as necessary.

That is much safer. If you are sure you have ONLY ICS component at both 
side, you can be sure of the behaviour. But anything between has just to be 
compliant with HTTP protocol and what you ask is more.


> On a different note, how do programs like "zebedee" provide a TCP/IP
> tunnel through a HTTP proxy? I understand how the "downstream" part
> works, but how about the "upstream" part?

This is quite easy. You can send the command "CONNECT" to a HTTP proxy and 
then the proxy will work transparently as a simple relay, without ever 
trying to understand what you send in the stream. This is how HTTPS works 
thru the proxy. Since HTTPS encrypt everything, the proxy is unable to do 
anything. It can just relay the data. That's the purpose of the "CONNECT" 
command.

--
Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
http://www.overbyte.be


-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Posting data to web server using THttpCli under usercontrol

2006-11-21 Thread Francois Piette
> I'm using THttpServer to send a document myself (using hgWillSendMySelf)
> so I can keep sending new data without requiring a new connection. It
> works just fine. Now I want to do the same the other way around: I want
> to use THttpCli to continually "post" data, without closing the
connection.

You can have a HTTP post which never ends. But probably it is not what you
really want. Since you control the client part, why not send as many HTTP
requests as you need ?

> without closing the connection.

You have not full control of connection close with HTTP protocol. If the
server decide to close it, it will be closed. You can request a persistant
connection using the property Connection and setting 'keep-alive' string as
value. See also ProxyConnection property used when traversing a proxy.

> Is it possible?
> Will it work through an HTTP proxy?

A post which never ends may have problem with filtering proxies because they
will not see the end of document and maybe they are buffering the document
until the end before processing it. So it would not works. If you use many
post one after the other, there will be no special problem.

Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
Author of ICS (Internet Component Suite, freeware)
Author of MidWare (Multi-tier framework, freeware)
http://www.overbyte.be

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


[twsocket] Posting data to web server using THttpCli under user control

2006-11-21 Thread Cosmin Prund
Hello everyone.

I'm using THttpServer to send a document myself (using hgWillSendMySelf) 
so I can keep sending new data without requiring a new connection. It 
works just fine. Now I want to do the same the other way around: I want 
to use THttpCli to continually "post" data, without closing the connection.

Is it possible?
Will it work through an HTTP proxy?

Thanks,
Cosmin Prund
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] POSTing images to a server

2006-08-30 Thread Mohit Sindhwani


Arno Garrels wrote:
> Mohit Sindhwani wrote:
>   
>> The basic POST works now - I can submit data to a form.  But, I can't
>> begin to get my head around the things involved in posting images to
>> the application.  I understand that I need to post it as a multi-part
>> form with a suitable separator for the parts, then set the correct
>> MIME type and content type, and encode the data.
>>
>> Has anyone tried this?  Is there some sample that I could refer to?
>> (I'm using BC++ Builder 5 right now)
>> 
>
> If think there's an example written in Delphi on the User Made page on
> the ICS homepage, search for HTTPCLIEXAMPLE.ZIP.
>
>
>   
Hi Arno,

Thanks for the link - I just downloaded the application and now looking 
through the source code.  I guess I'm just going to revisit some of my 
Delphi programming and convert it back to C++

Cheers
Mohit.


-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] POSTing images to a server

2006-08-30 Thread Arno Garrels
Mohit Sindhwani wrote:
> The basic POST works now - I can submit data to a form.  But, I can't
> begin to get my head around the things involved in posting images to
> the application.  I understand that I need to post it as a multi-part
> form with a suitable separator for the parts, then set the correct
> MIME type and content type, and encode the data.
> 
> Has anyone tried this?  Is there some sample that I could refer to?
> (I'm using BC++ Builder 5 right now)

If think there's an example written in Delphi on the User Made page on
the ICS homepage, search for HTTPCLIEXAMPLE.ZIP.

---
Arno Garrels [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


[twsocket] POSTing images to a server

2006-08-30 Thread Mohit Sindhwani
Hi!  I've just started to play with the Httpcli component and I'm hoping 
to create a program that will allow me to post images to a web application.

The basic POST works now - I can submit data to a form.  But, I can't 
begin to get my head around the things involved in posting images to the 
application.  I understand that I need to post it as a multi-part form 
with a suitable separator for the parts, then set the correct MIME type 
and content type, and encode the data.

Has anyone tried this?  Is there some sample that I could refer to?  
(I'm using BC++ Builder 5 right now)
Thanks,
Mohit.


-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be