Re: [WebDNA] TCPDoh

This WebDNA talk-list message is from

2009


It keeps the original formatting.
numero = 103316
interpreted = N
texte = --Apple-Mail-62--394891773 Content-Type: multipart/alternative; boundary=Apple-Mail-61--394891851 --Apple-Mail-61--394891851 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Figured it out - I thought I had to put the name variable pairs into TCPsend as content, but they go in the first part of TCPsend, right after POST. Stuart's ironically well timed post reminded me of how it really works. Thanks! This fixed my problem: [the_variables]
[middle startafter=&endbefore=][!] [/!][tcpconnect host=ssdi.rootsweb.ancestry.com&port=80][!] [/!][tcpsend skipheader=T]POST /cgi-bin/ssdi.cgi?[the_variables] HTTP/ 1.0[UnURL]%0D%0A[/UnURL][!] [/!]USER-AGENT: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0) [UnURL]%0D%0A[/UnURL][!] [/!][/TCPSend][!] [/!][/tcpconnect][!] [/!][/middle] On Aug 18, 2009, at 7:16 PM, Patrick McCormick wrote: > I tweaked the code a little. Only did a single %0D%0A for [crlf], > but added a second [crlf] before [/tcpsend] > > added /cgi-bin/ssdi.cgi? to the front of [the_variables]. Now I'm > getting this error: > > Bad Request > > Your browser sent a request that this server could not understand. > Request header field is missing ':' separator. > /cgi-bin/ssdi.cgi? > stat > = > a > &lastname > = > McCormick > &nt > = > exact > &firstname > = > Raymond > &middlename > = > A > &ssn > =&zip=54155&ls=WI&lc=&lct=Oneida&birth=&bmo=&bda=&death=&dmo=&issue= > > Apache/2.2.3 (CentOS) Server at ssdi.rootsweb.ancestry.com Port 80 > > > This is what tcpdump shows: > > POST /cgi-bin/ssdi.cgi HTTP/1.1 > Content-type: application/x-www-form-urlencoded > Content-length: 155 > /cgi-bin/ssdi.cgi? > stat > = > a > &lastname > = > McCormick > &nt > = > exact > &firstname > = > Raymond > &middlename > = > A > &ssn > =&zip=54155&ls=WI&lc=&lct=Oneida&birth=&bmo=&bda=&death=&dmo=&issue= > > > > here's the tweaked code I used: > > > > [text]crlf=[unurl]%0D%0A[/unurl][/text] > [search > db=people.db&eqfirstNamedata=Raymond&max=1]numfound=[numfound]
>[founditems] > [text]the_variables=/cgi-bin/ssdi.cgi? > stat > = > a > &lastname > = > [lastName > ]&nt > = > exact > &firstname > = > [firstName > ]&middlename > = > [middle > ]&ssn > = > [ssn > ]&zip > = > [zip > ]&ls > = > [state > ]&lc > = > [county > ]&lct > = > [city > ]&birth > = > [birthYear > ]&bmo > = > [birthMonth > ]&bda > =[birthDay]&death=[deathYear]&dmo=[deathMonth]&issue=[issueState][/ > text] > [/founditems][/search] > > [middle startafter=&endbefore=][tcpconnect > host=ssdi.rootsweb.ancestry.com&port=80] > [tcpsend]POST /cgi-bin/ssdi.cgi HTTP/1.1[crlf][!] > [/!]Content-type: application/x-www-form-urlencoded[crlf][!] > [/!]Content-length: [countchars][the_variables][/countchars][crlf][!] > [/!][the_variables][crlf][crlf][!] > [/!][/tcpsend] > [/tcpconnect] > [/middle] > > > On Aug 18, 2009, at 6:45 PM, Patrick McCormick wrote: > >> I need some fellow programmer's eyes to see what I'm missing: >> >> I'm sending a request to a CGI program on another server. >> >> If I paste this URL into a browser, it works fine: >> >> ssdi.rootsweb.ancestry.com/cgi-bin/ssdi.cgi? >> stat >> = >> a >> &lastname >> = >> McCormick >> &nt >> = >> exact >> &firstname >> = >> Raymond >> &middlename >> = >> A >> &ssn >> =&zip=54155&ls=WI&lc=&lct=Oneida&birth=&bmo=&bda=&death=&dmo=&issue= >> >> If I want to do that same thing using TCP connect/send, I put this >> in my page: >> >> ------------------------------------------------ >> >> >> [text]crlf=[unurl]%0D%0A%0D%0A[/unurl][/text] >> >> [search db=people.db&eqfirstNamedata=Raymond&max=1][founditems] >> >> [text]the_variables=stat=a&lastname=[lastName]&nt=exact&firstname=[firstName]&middlename=[middle]&ssn=[ssn]&zip=[zip]&ls=[state]&lc=[county]&lct=[city]&birth=[birthYear]&bmo=[birthMonth]&bda=[birthDay]&death=[deathYear]&dmo=[deathMonth]&issue=[issueState][/text] >> >> [/founditems][/search] >> >> [middle startafter=&endbefore=][tcpconnect >> host=ssdi.rootsweb.ancestry.com&port=80] >> [tcpsend]POST /cgi-bin/ssdi.cgi HTTP/1.1[crlf][!] >> [/!]Content-type: application/x-www-form-urlencoded[crlf][!] >> [/!]Content-length: [countchars][the_variables][/countchars][crlf][!] >> [/!][the_variables][crlf][!] >> [/!][/tcpsend] >> [/tcpconnect] >> [/middle] >> >> >> ------------------------------------------------ >> >> But I get: >> >> Bad Request >> >> Your browser sent a request that this server could not understand. >> Apache/2.2.3 (CentOS) Server at ssdi.rootsweb.ancestry.com Port 80 >> >> >> >> Can anyone see where I've messed up? >> >> Thanks, >> Pat > --Apple-Mail-61--394891851 Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Figured it out - I thought I = had to put the name variable pairs into TCPsend as content, but they go = in the first part of TCPsend, right after POST.  Stuart's = ironically well timed post reminded me of how it really works. =  Thanks!

This fixed my = problem:


<body>
[th= e_variables]<hr>
[middle = startafter=3D<body>&endbefore=3D</body>][!]
[/!]= [tcpconnect = host=3Dssdi.rootsweb.ancestry.com&port=3D80][!]
[/!][tcpsend= skipheader=3DT]POST /cgi-bin/ssdi.cgi?[the_variables] = HTTP/1.0[UnURL]%0D%0A[/UnURL][!]
[/!]USER-AGENT: Mozilla/4.0 = (compatible; MSIE 5.01; Windows NT = 5.0)
[UnURL]%0D%0A[/UnURL][!]
[/!][/TCPSend][!]
<= div>[/!][/tcpconnect][!]
[/!][/middle]
</body>



On Aug 18, = 2009, at 7:16 PM, Patrick McCormick wrote:

I tweaked the code a little. =  Only did a single %0D%0A for [crlf], but added a second [crlf] = before [/tcpsend]

added /cgi-bin/ssdi.cgi? to = the front of [the_variables].  Now I'm getting this = error:

Bad Request

Your browser sent = a request that this server could not understand.
Request header = field is missing ':' separator.
=

/cgi-bin/ssdi.cgi?stat=3Da&lastname=3DMcCormick&nt=3Dexac=t&firstname=3DRaymond&middlename=3DA&ssn=3D&zip=3D54155&am=p;ls=3DWI&lc=3D&lct=3DOneida&birth=3D&bmo=3D&bda=3D&am=p;death=3D&dmo=3D&issue=3D


Apache/2.2.3 = (CentOS) Server at ssdi.rootsweb.ancestry.com Port = 80


This is what tcpdump = shows:

POST /cgi-bin/ssdi.cgi = HTTP/1.1
Content-type: = application/x-www-form-urlencoded
Content-length: = 155
/cgi-bin/ssdi.cgi?stat=3Da&lastname=3DMcCormick&nt=3D= exact&firstname=3DRaymond&middlename=3DA&ssn=3D&zip=3D5415= 5&ls=3DWI&lc=3D&lct=3DOneida&birth=3D&bmo=3D&bda=3D= &death=3D&dmo=3D&issue=3D


<= /div>

here's the tweaked code I = used:


<body>
[text= ]crlf=3D[unurl]%0D%0A[/unurl][/text]
[search = db=3Dpeople.db&eqfirstNamedata=3DRaymond&max=3D1]numfound=3D[numfo= und]<br = />[founditems]
[text]the_variables=3D/cgi-bin/ssdi.cgi?stat=3D= a&lastname=3D[lastName]&nt=3Dexact&firstname=3D[firstName]&= ;middlename=3D[middle]&ssn=3D[ssn]&zip=3D[zip]&ls=3D[state]&am= p;lc=3D[county]&lct=3D[city]&birth=3D[birthYear]&bmo=3D[birthM= onth]&bda=3D[birthDay]&death=3D[deathYear]&dmo=3D[deathMonth]&= amp;issue=3D[issueState][/text]
[/founditems][/search]

[middle = startafter=3D<body>&endbefore=3D</body>][tcpconnect = host=3Dssdi.rootsweb.ancestry.com&port=3D80]
[tcpsend]POST = /cgi-bin/ssdi.cgi HTTP/1.1[crlf][!]
[/!]Content-type: = application/x-www-form-urlencoded[crlf][!]
[/!]Content-length: = [countchars][the_variables][/countchars][crlf][!]
[/!][the_varia= bles][crlf][crlf][!]
[/!][/tcpsend]
[/tcpconnect]
[/middle]
</body>

On = Aug 18, 2009, at 6:45 PM, Patrick McCormick wrote:

I need some fellow = programmer's eyes to see what I'm missing:

I'm = sending a request to a CGI program on another = server.

If I paste this URL into a browser, it = works = fine:

ssdi.rootsweb.ancestry.com/cgi-bin/ssdi.cgi= ?stat=3Da&lastname=3DMcCormick&nt=3Dexact&firstname=3DRaymond&= amp;middlename=3DA&ssn=3D&zip=3D54155&ls=3DWI&lc=3D&lc= t=3DOneida&birth=3D&bmo=3D&bda=3D&death=3D&dmo=3D&= issue=3D

If I want to do that same thing using = TCP connect/send, I put this in my = page:

-------------------------------------------= -----
<body>

[text]crlf=3D[u= nurl]%0D%0A%0D%0A[/unurl][/text]

[search = db=3Dpeople.db&eqfirstNamedata=3DRaymond&max=3D1][founditems]

[text]the_variables=3Dstat=3Da&lastname=3D[lastNa= me]&nt=3Dexact&firstname=3D[firstName]&middlename=3D[middle]&a= mp;ssn=3D[ssn]&zip=3D[zip]&ls=3D[state]&lc=3D[county]&lct=3D= [city]&birth=3D[birthYear]&bmo=3D[birthMonth]&bda=3D[birthDay]= &death=3D[deathYear]&dmo=3D[deathMonth]&issue=3D[issueState][/= text]

[/founditems][/search]

=
[middle = startafter=3D<body>&endbefore=3D</body>][tcpconnect = host=3Dssdi.rootsweb.ancestry.com&port=3D80]
[tcpsend]POST = /cgi-bin/ssdi.cgi HTTP/1.1[crlf][!]
[/!]Content-type: = application/x-www-form-urlencoded[crlf][!]
[/!]Content-length: = [countchars][the_variables][/countchars][crlf][!]
[/!][the_varia= bles][crlf][!]
[/!][/tcpsend]
[/tcpconnect]
= [/middle]

</body>
---------------= ---------------------------------

But I = get:

Bad Request

Your browser sent a = request that this server could not understand.


=
Apache/2.2.3 (CentOS) Server at ssdi.rootsweb.ancestry.com Port = 80



<= /div>
Can anyone see where I've messed = up?

Thanks,
Pat


= --Apple-Mail-61--394891851-- --Apple-Mail-62--394891773 Content-Disposition: attachment; filename=smime.p7s Content-Type: application/pkcs7-signature; name=smime.p7s Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIGGTCCAtIw ggI7oAMCAQICEBmvvAg5L6PclE8ruwo/gMYwDQYJKoZIhvcNAQ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QuMSwwKgYDVQQDEyNUaGF3dGUgUGVyc29uYWwgRnJl ZW1haWwgSXNzdWluZyBDQQIQGa+8CDkvo9yUTyu7Cj+AxjAJBgUrDgMCGgUAoIIBbzAYBgkqhkiG 9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0wOTA4MTkwMDQ1MzFaMCMGCSqGSIb3 DQEJBDEWBBQ1K5P/QJhB3ndIuccYxNwAACM8njCBhQYJKwYBBAGCNxAEMXgwdjBiMQswCQYDVQQG EwJaQTElMCMGA1UEChMcVGhhd3RlIENvbnN1bHRpbmcgKFB0eSkgTHRkLjEsMCoGA1UEAxMjVGhh d3RlIFBlcnNvbmFsIEZyZWVtYWlsIElzc3VpbmcgQ0ECEBmvvAg5L6PclE8ruwo/gMYwgYcGCyqG SIb3DQEJEAILMXigdjBiMQswCQYDVQQGEwJaQTElMCMGA1UEChMcVGhhd3RlIENvbnN1bHRpbmcg KFB0eSkgTHRkLjEsMCoGA1UEAxMjVGhhd3RlIFBlcnNvbmFsIEZyZWVtYWlsIElzc3VpbmcgQ0EC EBmvvAg5L6PclE8ruwo/gMYwDQYJKoZIhvcNAQEBBQAEggEAQ5ul1bY3PHdEqrxVtnw3rqEZ1LDw i+gzw1sUUpL9/5TF73tRDmINbu+/WMFSLQlCPwEWD5xwBbtFfp7T3ElnkkqBw1WYFpXENl1LDutP AakruVL6DkuRmq26E5rVEtWtjrjFaNbV42U4TVfWfWH108qfN7MaXp3dSQPrNFBGw3K9nTy1ZiTn uCjieswJEXDCqD88xHqiSKziCsDpyDSXrh5HsUW4ddJMnzZwQKBOS2BxTEYWCS+QfAJLAjjlF2UG WVwBpk7n4MM1BYHKJGj2geilF1TT5RaiyDu+qSvEgIPPJqcxO8gcdhS0A/qg+x5Z/p1/IukpL2YB PUdlgN7gbgAAAAAAAA== --Apple-Mail-62--394891773-- Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] TCPDoh (Patrick McCormick 2009)
  2. Re: [WebDNA] TCPDoh (Stuart Tremain 2009)
  3. Re: [WebDNA] TCPDoh (Patrick McCormick 2009)
  4. Re: [WebDNA] TCPDoh (Patrick McCormick 2009)
  5. [WebDNA] TCPDoh (Patrick McCormick 2009)
--Apple-Mail-62--394891773 Content-Type: multipart/alternative; boundary=Apple-Mail-61--394891851 --Apple-Mail-61--394891851 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Figured it out - I thought I had to put the name variable pairs into TCPsend as content, but they go in the first part of TCPsend, right after POST. Stuart's ironically well timed post reminded me of how it really works. Thanks! This fixed my problem: [the_variables]
[middle startafter=&endbefore=][!] [/!][tcpconnect host=ssdi.rootsweb.ancestry.com&port=80][!] [/!][tcpsend skipheader=T]POST /cgi-bin/ssdi.cgi?[the_variables] HTTP/ 1.0[unurl]%0D%0A[/UnURL][!] [/!]USER-AGENT: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0) [unurl]%0D%0A[/UnURL][!] [/!][/TCPSend][!] [/!][/tcpconnect][!] [/!][/middle] On Aug 18, 2009, at 7:16 PM, Patrick McCormick wrote: > I tweaked the code a little. Only did a single %0D%0A for [crlf], > but added a second [crlf] before [/tcpsend] > > added /cgi-bin/ssdi.cgi? to the front of [the_variables]. Now I'm > getting this error: > > Bad Request > > Your browser sent a request that this server could not understand. > Request header field is missing ':' separator. > /cgi-bin/ssdi.cgi? > stat > = > a > &lastname > = > McCormick > &nt > = > exact > &firstname > = > Raymond > &middlename > = > A > &ssn > =&zip=54155&ls=WI&lc=&lct=Oneida&birth=&bmo=&bda=&death=&dmo=&issue= > > Apache/2.2.3 (CentOS) Server at ssdi.rootsweb.ancestry.com Port 80 > > > This is what tcpdump shows: > > POST /cgi-bin/ssdi.cgi HTTP/1.1 > Content-type: application/x-www-form-urlencoded > Content-length: 155 > /cgi-bin/ssdi.cgi? > stat > = > a > &lastname > = > McCormick > &nt > = > exact > &firstname > = > Raymond > &middlename > = > A > &ssn > =&zip=54155&ls=WI&lc=&lct=Oneida&birth=&bmo=&bda=&death=&dmo=&issue= > > > > here's the tweaked code I used: > > > > [text]crlf=[unurl]%0D%0A[/unurl][/text] > [search > db=people.db&eqfirstNamedata=Raymond&max=1]numfound=[numfound]
>[founditems] > [text]the_variables=/cgi-bin/ssdi.cgi? > stat > = > a > &lastname > = > [lastName > ]&nt > = > exact > &firstname > = > [firstName > ]&middlename > = > [middle > ]&ssn > = > [ssn > ]&zip > = > [zip > ]&ls > = > [state > ]&lc > = > [county > ]&lct > = > [city > ]&birth > = > [birthYear > ]&bmo > = > [birthMonth > ]&bda > =[birthDay]&death=[deathYear]&dmo=[deathMonth]&issue=[issueState][/ > text] > [/founditems][/search] > > [middle startafter=&endbefore=][tcpconnect > host=ssdi.rootsweb.ancestry.com&port=80] > [tcpsend]POST /cgi-bin/ssdi.cgi HTTP/1.1[crlf][!] > [/!]Content-type: application/x-www-form-urlencoded[crlf][!] > [/!]Content-length: [countchars][the_variables][/countchars][crlf][!] > [/!][the_variables][crlf][crlf][!] > [/!][/tcpsend] > [/tcpconnect] > [/middle] > > > On Aug 18, 2009, at 6:45 PM, Patrick McCormick wrote: > >> I need some fellow programmer's eyes to see what I'm missing: >> >> I'm sending a request to a CGI program on another server. >> >> If I paste this URL into a browser, it works fine: >> >> ssdi.rootsweb.ancestry.com/cgi-bin/ssdi.cgi? >> stat >> = >> a >> &lastname >> = >> McCormick >> &nt >> = >> exact >> &firstname >> = >> Raymond >> &middlename >> = >> A >> &ssn >> =&zip=54155&ls=WI&lc=&lct=Oneida&birth=&bmo=&bda=&death=&dmo=&issue= >> >> If I want to do that same thing using TCP connect/send, I put this >> in my page: >> >> ------------------------------------------------ >> >> >> [text]crlf=[unurl]%0D%0A%0D%0A[/unurl][/text] >> >> [search db=people.db&eqfirstNamedata=Raymond&max=1][founditems] >> >> [text]the_variables=stat=a&lastname=[lastName]&nt=exact&firstname=[firstName]&middlename=[middle]&ssn=[ssn]&zip=[zip]&ls=[state]&lc=[county]&lct=[city]&birth=[birthYear]&bmo=[birthMonth]&bda=[birthDay]&death=[deathYear]&dmo=[deathMonth]&issue=[issueState][/text] >> >> [/founditems][/search] >> >> [middle startafter=&endbefore=][tcpconnect >> host=ssdi.rootsweb.ancestry.com&port=80] >> [tcpsend]POST /cgi-bin/ssdi.cgi HTTP/1.1[crlf][!] >> [/!]Content-type: application/x-www-form-urlencoded[crlf][!] >> [/!]Content-length: [countchars][the_variables][/countchars][crlf][!] >> [/!][the_variables][crlf][!] >> [/!][/tcpsend] >> [/tcpconnect] >> [/middle] >> >> >> ------------------------------------------------ >> >> But I get: >> >> Bad Request >> >> Your browser sent a request that this server could not understand. >> Apache/2.2.3 (CentOS) Server at ssdi.rootsweb.ancestry.com Port 80 >> >> >> >> Can anyone see where I've messed up? >> >> Thanks, >> Pat > --Apple-Mail-61--394891851 Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Figured it out - I thought I = had to put the name variable pairs into TCPsend as content, but they go = in the first part of TCPsend, right after POST.  Stuart's = ironically well timed post reminded me of how it really works. =  Thanks!

This fixed my = problem:


<body>
[th= e_variables]<hr>
[middle = startafter=3D<body>&endbefore=3D</body>][!]
[/!]= [tcpconnect = host=3Dssdi.rootsweb.ancestry.com&port=3D80][!]
[/!][tcpsend= skipheader=3DT]POST /cgi-bin/ssdi.cgi?[the_variables] = HTTP/1.0[unurl]%0D%0A[/UnURL][!]
[/!]USER-AGENT: Mozilla/4.0 = (compatible; MSIE 5.01; Windows NT = 5.0)
[unurl]%0D%0A[/UnURL][!]
[/!][/TCPSend][!]
<= div>[/!][/tcpconnect][!]
[/!][/middle]
</body>



On Aug 18, = 2009, at 7:16 PM, Patrick McCormick wrote:

I tweaked the code a little. =  Only did a single %0D%0A for [crlf], but added a second [crlf] = before [/tcpsend]

added /cgi-bin/ssdi.cgi? to = the front of [the_variables].  Now I'm getting this = error:

Bad Request

Your browser sent = a request that this server could not understand.
Request header = field is missing ':' separator.
=

/cgi-bin/ssdi.cgi?stat=3Da&lastname=3DMcCormick&nt=3Dexac=t&firstname=3DRaymond&middlename=3DA&ssn=3D&zip=3D54155&am=p;ls=3DWI&lc=3D&lct=3DOneida&birth=3D&bmo=3D&bda=3D&am=p;death=3D&dmo=3D&issue=3D


Apache/2.2.3 = (CentOS) Server at ssdi.rootsweb.ancestry.com Port = 80


This is what tcpdump = shows:

POST /cgi-bin/ssdi.cgi = HTTP/1.1
Content-type: = application/x-www-form-urlencoded
Content-length: = 155
/cgi-bin/ssdi.cgi?stat=3Da&lastname=3DMcCormick&nt=3D= exact&firstname=3DRaymond&middlename=3DA&ssn=3D&zip=3D5415= 5&ls=3DWI&lc=3D&lct=3DOneida&birth=3D&bmo=3D&bda=3D= &death=3D&dmo=3D&issue=3D


<= /div>

here's the tweaked code I = used:


<body>
[text= ]crlf=3D[unurl]%0D%0A[/unurl][/text]
[search = db=3Dpeople.db&eqfirstNamedata=3DRaymond&max=3D1]numfound=3D[numfo= und]<br = />[founditems]
[text]the_variables=3D/cgi-bin/ssdi.cgi?stat=3D= a&lastname=3D[lastName]&nt=3Dexact&firstname=3D[firstName]&= ;middlename=3D[middle]&ssn=3D[ssn]&zip=3D[zip]&ls=3D[state]&am= p;lc=3D[county]&lct=3D[city]&birth=3D[birthYear]&bmo=3D[birthM= onth]&bda=3D[birthDay]&death=3D[deathYear]&dmo=3D[deathMonth]&= amp;issue=3D[issueState][/text]
[/founditems][/search]

[middle = startafter=3D<body>&endbefore=3D</body>][tcpconnect = host=3Dssdi.rootsweb.ancestry.com&port=3D80]
[tcpsend]POST = /cgi-bin/ssdi.cgi HTTP/1.1[crlf][!]
[/!]Content-type: = application/x-www-form-urlencoded[crlf][!]
[/!]Content-length: = [countchars][the_variables][/countchars][crlf][!]
[/!][the_varia= bles][crlf][crlf][!]
[/!][/tcpsend]
[/tcpconnect]
[/middle]
</body>

On = Aug 18, 2009, at 6:45 PM, Patrick McCormick wrote:

I need some fellow = programmer's eyes to see what I'm missing:

I'm = sending a request to a CGI program on another = server.

If I paste this URL into a browser, it = works = fine:

ssdi.rootsweb.ancestry.com/cgi-bin/ssdi.cgi= ?stat=3Da&lastname=3DMcCormick&nt=3Dexact&firstname=3DRaymond&= amp;middlename=3DA&ssn=3D&zip=3D54155&ls=3DWI&lc=3D&lc= t=3DOneida&birth=3D&bmo=3D&bda=3D&death=3D&dmo=3D&= issue=3D

If I want to do that same thing using = TCP connect/send, I put this in my = page:

-------------------------------------------= -----
<body>

[text]crlf=3D[u= nurl]%0D%0A%0D%0A[/unurl][/text]

[search = db=3Dpeople.db&eqfirstNamedata=3DRaymond&max=3D1][founditems]

[text]the_variables=3Dstat=3Da&lastname=3D[lastNa= me]&nt=3Dexact&firstname=3D[firstName]&middlename=3D[middle]&a= mp;ssn=3D[ssn]&zip=3D[zip]&ls=3D[state]&lc=3D[county]&lct=3D= [city]&birth=3D[birthYear]&bmo=3D[birthMonth]&bda=3D[birthDay]= &death=3D[deathYear]&dmo=3D[deathMonth]&issue=3D[issueState][/= text]

[/founditems][/search]

=
[middle = startafter=3D<body>&endbefore=3D</body>][tcpconnect = host=3Dssdi.rootsweb.ancestry.com&port=3D80]
[tcpsend]POST = /cgi-bin/ssdi.cgi HTTP/1.1[crlf][!]
[/!]Content-type: = application/x-www-form-urlencoded[crlf][!]
[/!]Content-length: = [countchars][the_variables][/countchars][crlf][!]
[/!][the_varia= bles][crlf][!]
[/!][/tcpsend]
[/tcpconnect]
= [/middle]

</body>
---------------= ---------------------------------

But I = get:

Bad Request

Your browser sent a = request that this server could not understand.


=
Apache/2.2.3 (CentOS) Server at ssdi.rootsweb.ancestry.com Port = 80



<= /div>
Can anyone see where I've messed = up?

Thanks,
Pat


= --Apple-Mail-61--394891851-- --Apple-Mail-62--394891773 Content-Disposition: attachment; filename=smime.p7s Content-Type: application/pkcs7-signature; name=smime.p7s Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIG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Cormick

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

Card clearance, problems - solutions? (1997) Merging databases (1997) Did you hear about this? (1997) WebCat2: Items xx to xx shown, etc. (1997) [foundItems] context problem (2000) form data submission gets truncated (1997) Formatting of email on NT (1998) [WebDNA] MD5 Hash issue (2009) WebCat2.0 acgi vs plugin (1997) SMSI FTP - calendar system (2002) WebCat 5 Intranet Question (2003) WebDNA wholesale ... (2002) Discounts (1998) MySQL and Numbers (2005) orders being printed (1998) Running _every_ page through WebCat ? (1997) 2nd Request for help/advice on variable pricing + MORE (2000) WebCat2 - [include] tags (1997) _ in front of field name (1998) Commas in search (1998)