Re: [WebDNA] TCPDoh

This WebDNA talk-list message is from

2009


It keeps the original formatting.
numero = 103317
interpreted = N
texte = Great !! I was going to suggest putting in a user agent. It seems that it has become increasingly necessary these days as so many sites/services display the site differently based on user agent. Regards Stuart Tremain IDFK Web Developments AUSTRALIA webdna@idfk.com.au On 19/08/2009, at 10:45 AM, Patrick McCormick wrote: > 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 >> > 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)
Great !! I was going to suggest putting in a user agent. It seems that it has become increasingly necessary these days as so many sites/services display the site differently based on user agent. Regards Stuart Tremain IDFK Web Developments AUSTRALIA webdna@idfk.com.au On 19/08/2009, at 10:45 AM, Patrick McCormick wrote: > 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 >> > Stuart Tremain

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:

Week # problem (1998) GuestBook example (1997) Multiple fields on 1 input (1997) Re2: Calculating multiple shipping... (1997) Plugin or CGI or both (1997) RequiredFields notes ... (1997) [SHOWIF AND/OR] (1997) WebCatalog for Postcards ? (1997) UPDATE PROBLEM (1997) b12 cannot limit records returned and more. (1997) Fwd: Problems with Webcatalog Plug-in (1997) taxTotal confusion (1998) OT: Email Spam a bit of Hell (2004) WebCat2b12--[searchstring] bug (1997) Separate SSL Server (1997) Re:Variable Math (1998) # of real domains on 1 web server (1997) Country & Ship-to address & other fields ? (1997) PROTECT/AUTHORIZE (2002) Mac v. NT (1998)