Alaska Software Inc. - HTTP string protocol
Username: Password:
AuthorTopic: HTTP string protocol
Carlos SantosHTTP string protocol
on Mon, 06 Mar 2006 18:18:35 +0000
Hi,
I need a function that converts any string in a string that is compatible 
with HTTP protocol and the inverse function.
Has xBase++ such functions or anybody writen one?
Thanks,
Carlos
mark carew Re: HTTP string protocol
on Tue, 07 Mar 2006 05:26:29 +1000
On Mon, 6 Mar 2006 18:18:35 -0000, Carlos Santos wrote:

> Hi,
> I need a function that converts any string in a string that is compatible 
> with HTTP protocol and the inverse function.
> Has xBase++ such functions or anybody writen one?
> Thanks,
> Carlos

Hi Carlos,

Html Reflection is available in xBass++. Its the htfclass lib. I don't know
if it is only available in the professional subscription or if it comes in
the standard subscription. 

Regards
  Mark
mark carew Re: HTTP string protocol
on Tue, 07 Mar 2006 05:27:40 +1000
On Tue, 7 Mar 2006 05:26:29 +1000, mark carew wrote:

> On Mon, 6 Mar 2006 18:18:35 -0000, Carlos Santos wrote:
> 
>> Hi,
>> I need a function that converts any string in a string that is compatible 
>> with HTTP protocol and the inverse function.
>> Has xBase++ such functions or anybody writen one?
>> Thanks,
>> Carlos
> 
> Hi Carlos,
> 
> Html Reflection is available in xBass++. Its the htfclass lib. I don't know
> if it is only available in the professional subscription or if it comes in
> the standard subscription. 
> 
> Regards
>   Mark

Hi Carlos,
	That should have read hrfclass (first cup of coffee hasn't sunk in yet).
Mark
Carlos SantosRe: HTTP string protocol
on Fri, 10 Mar 2006 09:17:28 +0000
Hi,
I try to clarify the problem:
I'm using a function based on Phil's LoadFromUrl to comunicate with my 
server app via Apache (without WAA)
   HTTP( cIpAddress, "cgi-bin/cgi.exe", 
"_PACKAGE=MSG&_FORM=TEST&TEST="+cString, "POST" )
With this client command, Apache run cgi.exe that receives the string 
cString and pass it to the server app.Because cString may contain characters 
with special meaning (&,=,%), the server cut it or do wrong things in it. 
So, I need a function to convert my cString into a compatible one with HTTP 
protocol and back again to the original.
Thanks,
Carlos

"mark carew" <markcarew@magicwanddept.com.au> escreveu na mensagem 
news:j60ff7jndw4e.11mqf6yk6wdw8.dlg@40tude.net...
> On Tue, 7 Mar 2006 05:26:29 +1000, mark carew wrote:
>
>> On Mon, 6 Mar 2006 18:18:35 -0000, Carlos Santos wrote:
>>
>>> Hi,
>>> I need a function that converts any string in a string that is 
>>> compatible
>>> with HTTP protocol and the inverse function.
>>> Has xBase++ such functions or anybody writen one?
>>> Thanks,
>>> Carlos
>>
>> Hi Carlos,
>>
>> Html Reflection is available in xBass++. Its the htfclass lib. I don't 
>> know
>> if it is only available in the professional subscription or if it comes 
>> in
>> the standard subscription.
>>
>> Regards
>>   Mark
>
> Hi Carlos,
> That should have read hrfclass (first cup of coffee hasn't sunk in yet).
> Mark
Boris Borzic Re: HTTP string protocol
on Fri, 10 Mar 2006 14:52:07 +0100
"Carlos Santos" <paulino@psic.pt> wrote in
news:1b6087dc$40f0b8f0$1a2f56@news.alaska-software.com: 

> I try to clarify the problem:
> I'm using a function based on Phil's LoadFromUrl to comunicate with my
> server app via Apache (without WAA)
>    HTTP( cIpAddress, "cgi-bin/cgi.exe", 
> "_PACKAGE=MSG&_FORM=TEST&TEST="+cString, "POST" )
> With this client command, Apache run cgi.exe that receives the string 
> cString and pass it to the server app.Because cString may contain
> characters with special meaning (&,=,%), the server cut it or do wrong
> things in it. So, I need a function to convert my cString into a
> compatible one with HTTP protocol and back again to the original.

If you have the Xb2.NET library you can do URL encoding/decoding using 
the functions xbURLEncode/xbURLDecode as well as the xbURI class, eg:

 parse an encoded URI:
oURI := xbURI():new()
oURI:Parse("http://xb2.net/dir1/dir%202/prog.exe?xyz&par1=val1
&EmptyVal=&par2=val2+val3#fragment")
? "Scheme   :", oURI:Scheme 
? "Authority:", oURI:Authority 
? "Path     :", oURI:Path 
? "Fragment :", oURI:Fragment 
? "Query    :", oURI:Query 
? "VarList  :", oURI:GetVar()
? "Par1     :", oURI:GetVar("Par1") 
? "Par2     :", oURI:GetVar("Par2") 
? "EmptyVal :", oURI:GetVar("EmptyVal") 
? "Not Found:", oURI:GetVar("Doesn't Exist") 

 screen output:
Scheme   : http                                                     
Authority: xb2.net                                                  
Path     : /dir1/dir 2/prog.exe                                     
Fragment : fragment                                                 
Query    : xyz&par1=val1&EmptyVal=&par2=val2+val3                   
VarList  : {{1, xyz}, {par1, val1}, {EmptyVal, }, {par2, val2 val3}}
Par1     : val1                                                     
Par2     : val2 val3                                                
EmptyVal :                                                          
Not Found: NIL                                                      


 encode URI components for safe transport:
oURI:Reset()
oURI:scheme    := "https"
oURI:authority := "207.193.8.24"
oURI:Path      := "cgi-bin/cgi.exe"
oURI:SetVar("_PACKAGE", "Test")
oURI:SetVar("_FORM", "my form")
oURI:SetVar("DATA", "this & that")

? "Encoded Query:", oURI:Query()
? "Encoded URI  :", oURI:AsString()

 screen output:
Encoded Query: _PACKAGE=Test&_FORM=my%20form&DATA=this%20%26%20that             
Encoded URI  : https://207.193.8.24/cgi-bin/cgi.exe?
_PACKAGE=Test&_FORM=my%20form&DATA=this%20%26%20that                                                        

Best regards,
Boris Borzic

news://news.Xb2.NET
http://www.Xb2.NET
http://www.SQLExpress.net
industrial strength Xbase++ development tools
Thomas Braun
Re: HTTP string protocol
on Mon, 13 Mar 2006 09:56:35 +0100
Carlos Santos wrote:

> With this client command, Apache run cgi.exe that receives the string 
> cString and pass it to the server app.Because cString may contain characters 
> with special meaning (&,=,%), the server cut it or do wrong things in it. 
> So, I need a function to convert my cString into a compatible one with HTTP 
> protocol and back again to the original.

You can use the following information and code it yourself:

http://www.w3schools.com/tags/ref_urlencode.asp
http://en.wikipedia.org/wiki/URL_Encoding

...or use the library from Boris - which is what I would recommend, not
only because of supporting the global economy, but because you have a lot
of additional functions when dealing with internet protocols. 

Most likely the price to purchase the lib is less than the cost of
developing this single function by yourself.

Thomas
Carlos SantosRe: HTTP string protocol
on Mon, 13 Mar 2006 12:26:51 +0000
Hi Thomas,
Is that table I need. Do you have a table of which characters need to be 
converted?
Thanks,
Carlos



"Thomas Braun" <spam@software-braun.de> escreveu na mensagem 
news:13oa6qgdskimf$.9liv78wksd6s$.dlg@40tude.net...
> Carlos Santos wrote:
>
>> With this client command, Apache run cgi.exe that receives the string
>> cString and pass it to the server app.Because cString may contain 
>> characters
>> with special meaning (&,=,%), the server cut it or do wrong things in it.
>> So, I need a function to convert my cString into a compatible one with 
>> HTTP
>> protocol and back again to the original.
>
> You can use the following information and code it yourself:
>
> http://www.w3schools.com/tags/ref_urlencode.asp
> http://en.wikipedia.org/wiki/URL_Encoding
>
> ...or use the library from Boris - which is what I would recommend, not
> only because of supporting the global economy, but because you have a lot
> of additional functions when dealing with internet protocols.
>
> Most likely the price to purchase the lib is less than the cost of
> developing this single function by yourself.
>
> Thomas
Vladimir IahnencoRe: HTTP string protocol
on Mon, 13 Mar 2006 10:39:30 -0500
Hi Mark,
I would recommend to install Fiddler. In fiddler you will able to see 
request and response messages formats and also to check if you have some 
characters to substitute. Personally me I don't convert, as I remember 
windows dlls calls did everything required.


Regards,
Vladimir

"Carlos Santos" <paulino@psic.pt> wrote in message 
news:177bf89f$48954afc$1ac572@news.alaska-software.com...
> Hi Thomas,
> Is that table I need. Do you have a table of which characters need to be 
> converted?
> Thanks,
> Carlos
>
>
>
> "Thomas Braun" <spam@software-braun.de> escreveu na mensagem 
> news:13oa6qgdskimf$.9liv78wksd6s$.dlg@40tude.net...
>> Carlos Santos wrote:
>>
>>> With this client command, Apache run cgi.exe that receives the string
>>> cString and pass it to the server app.Because cString may contain 
>>> characters
>>> with special meaning (&,=,%), the server cut it or do wrong things in 
>>> it.
>>> So, I need a function to convert my cString into a compatible one with 
>>> HTTP
>>> protocol and back again to the original.
>>
>> You can use the following information and code it yourself:
>>
>> http://www.w3schools.com/tags/ref_urlencode.asp
>> http://en.wikipedia.org/wiki/URL_Encoding
>>
>> ...or use the library from Boris - which is what I would recommend, not
>> only because of supporting the global economy, but because you have a lot
>> of additional functions when dealing with internet protocols.
>>
>> Most likely the price to purchase the lib is less than the cost of
>> developing this single function by yourself.
>>
>> Thomas
>
>
Boris Borzic Re: HTTP string protocol
on Mon, 06 Mar 2006 21:07:04 +0100
"Carlos Santos" <paulino@psic.pt> wrote in
news:4eaef61f$2b66dfcf$15bfb0@news.alaska-software.com: 

> I need a function that converts any string in a string that is
> compatible with HTTP protocol and the inverse function.

Are you asking about HTTP or HTML? There is a big difference 
If you need HTTP request/response functions then have a look at Xb2.NET. 

The xbHTTPRequest and xbHTTPResponse classes included in Xb2.NET provide 
the basis doing any type of HTTP work. Each of these classes can be used 
from both a client and server perspective. To receive a fully functional 
version of Xb2.NET, send an email as follows: 
mailto:demo@xb2.net?subject=Xb2.NET_demo

Best regards,
Boris Borzic

news://news.Xb2.NET
http://www.Xb2.NET
http://www.SQLExpress.net
industrial strength Xbase++ development tools