Re: TCPsend with POST?

This WebDNA talk-list message is from

1999


It keeps the original formatting.
numero = 25004
interpreted = N
texte = On 12/2/99 9:57 am, Matthias Precht so noted...>Did anyone of you get TCPsend to work with POST-Requests? >I tried to figure out a correct HTTP-header with OTSessionWatcher, but >this code does not work: > >[TCPconnect host=www.foo.net&port=80] >[TCPsend]POST /foo.asp HTTP/1.0[unurl]%0D%0A[/unurl]Referer: >http://www.foo.net/foo.asp[unurl]%0D%0A[/unurl]User-Agent: Mozilla/4.5 >[de] (Macintosh; I; PPC)[unurl]%0D%0A[/unurl]Host: >www.foo.net[unurl]%0D%0A[/unurl]Content-type: >application/x-www-form-urlencoded[unurl]%0D%0A[/unurl]Content-lenght: >200[unurl]%0D%0A[/unurl][unurl]%0D[/unurl][unurl]%0A[/unurl][formvariables >name=t_&exact=F][getchars >start=3][name][/getchars]=[url][value][/url]&[/formvariables]x=47&y=15[unu >rl]%0D%0A[/unurl][/tcpsend] >[/TCPconnect] > >The remote server seems not to get the query strings.Could you try removing the [TCPconnect] and [TCPsend] tags to have it display on screen and see if the page is creating the proper structure?There's a typo in the Content-length: header. And unless you're always going to be sending exactly 200 characters, you'll need to do a [countChars] on the data you're sending (including variable names, = and & characters).Otherwise, it looks very similar to what I've used in the past to send POST submissions to Filemaker.FYI, the line [unurl]%0D%0A[/unurl][unurl]%0D[/unurl][unurl]%0A[/unurl] could simply be [unurl]%0D%0A%0D%0A[/unurl] -- or set the mess to a text variable at the top for reuse in your code, ie. [text]CRLF=[unurl]%0D%0A[/unurl][/text].Rob Marquardt Designer/Resident Wirehead Toast Design800 Washington Avenue North Minneapolis MN 55401 612.330.9863 v 612.321.9424 f www.toastdesign.com ------------------------------------------------------------- Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. To end your Mail problems go to .This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Associated Messages, from the most recent to the oldest:

    
  1. Re: TCPsend with POST? (Rob Marquardt 1999)
  2. TCPsend with POST? (Matthias Precht 1999)
On 12/2/99 9:57 am, Matthias Precht so noted...>Did anyone of you get TCPsend to work with POST-Requests? >I tried to figure out a correct HTTP-header with OTSessionWatcher, but >this code does not work: > >[TCPconnect host=www.foo.net&port=80] >[tcpsend]POST /foo.asp HTTP/1.0[unurl]%0D%0A[/unurl]Referer: >http://www.foo.net/foo.asp[unurl]%0D%0A[/unurl]User-Agent: Mozilla/4.5 >[de] (Macintosh; I; PPC)[unurl]%0D%0A[/unurl]Host: >www.foo.net[unurl]%0D%0A[/unurl]Content-type: >application/x-www-form-urlencoded[unurl]%0D%0A[/unurl]Content-lenght: >200[unurl]%0D%0A[/unurl][unurl]%0D[/unurl][unurl]%0A[/unurl][formvariables >name=t_&exact=F][getchars >start=3][name][/getchars]=[url][value][/url]&[/formvariables]x=47&y=15[unu >rl]%0D%0A[/unurl][/tcpsend] >[/TCPconnect] > >The remote server seems not to get the query strings.Could you try removing the [tcpconnect] and [tcpsend] tags to have it display on screen and see if the page is creating the proper structure?There's a typo in the Content-length: header. And unless you're always going to be sending exactly 200 characters, you'll need to do a [countchars] on the data you're sending (including variable names, = and & characters).Otherwise, it looks very similar to what I've used in the past to send POST submissions to Filemaker.FYI, the line [unurl]%0D%0A[/unurl][unurl]%0D[/unurl][unurl]%0A[/unurl] could simply be [unurl]%0D%0A%0D%0A[/unurl] -- or set the mess to a text variable at the top for reuse in your code, ie. [text]CRLF=[unurl]%0D%0A[/unurl][/text].Rob Marquardt Designer/Resident Wirehead Toast Design800 Washington Avenue North Minneapolis MN 55401 612.330.9863 v 612.321.9424 f www.toastdesign.com ------------------------------------------------------------- Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. To end your Mail problems go to .This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Rob Marquardt

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:

WebCat b13 CGI -shownext- (1997) Paypal merchant code tricks or pitfalls (2003) FEW QUESTIONS (1997) [redirect] question (2005) two unique banners on one page (1997) URL too Long? (1997) writefile and texte (1997) WC2b12: Yes, Formulas.db is for real (1997) showif math date (2002) Searching multiple Databases (1997) PSC recommends what date format yr 2000??? (1997) Summary Searches (2000) WSDL Wizard (2003) Webcatalog/Butler (1998) Shipping Costs Not Updating When Adding Items (1997) [WebDNA] Encrypt / Decrypt weirdness..... plus some date weirdness (2015) blank page from template (1997) TCP Connect (1999) textarea text truncated by browser (2000) How to get shownext to just shownext once (1997)