Re: FW: Username and password in tcp connect/send

This WebDNA talk-list message is from

2001


It keeps the original formatting.
numero = 39973
interpreted = N
texte = Marc M. wrote: > > I have a tcp connect/send which seems to work fine except for the page being > accessed is realm based username and password protected. How would I > incorporate my username and password into the tcp send? > > [text]post_data=myform name value pairs here[/text] > > [tcpconnect host=myhost.com] > [tcpsend]POST /.portweb?adminshow HTTP/1.0[UnURL]%0D%0A[/UnURL][!] > [/!]USER-AGENT: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT > 5.0)[UnURL]%0D%0A[/UnURL][!] > [/!]Content-type: application/x-www-form-urlencoded[UnURL]%0D%0A[/UnURL][!] > [/!]Content-length:[!] > [/!][CountChars][post_data][/CountChars][UnURL]%0D%0A[/UnURL][!] [/!]Authorization: Basic [encrypt method=Base64][username]:[password][/encrypt][UnURL]%0D%0A[/UnURL][!] > [/!][post_data][UnURL]%0D%0A[/UnURL][!] [/!][UnURL]%0D%0A[/UnURL][!] > [/!][/TCPSend] > [/tcpconnect] > > ------ End of Forwarded MessageNote that I made two changes. I added the Authorization: Basic line and I moved the double CR/LF to the end, after the [post_data]. The rules for HTTP requests are very specific: the request is terminated by two CR/LF pairs. The form post data must be followed by the two blank lines, not preceeded.Get yourself a copy of something like net.demon (Windows only) that allows you to see the actual HTTP request and response: http://www.netdemon.net/ HTHJohn-- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4720 Boston Way Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5747------------------------------------------------------------- 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 Web Archive of this list is at: http://search.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. FW: Username and password in tcp connect/send (Marc M. 2001)
  2. Re: FW: Username and password in tcp connect/send (John Peacock 2001)
  3. FW: Username and password in tcp connect/send (Marc M. 2001)
Marc M. wrote: > > I have a tcp connect/send which seems to work fine except for the page being > accessed is realm based username and password protected. How would I > incorporate my username and password into the tcp send? > > [text]post_data=myform name value pairs here[/text] > > [tcpconnect host=myhost.com] > [tcpsend]POST /.portweb?adminshow HTTP/1.0[unurl]%0D%0A[/UnURL][!] > [/!]USER-AGENT: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT > 5.0)[unurl]%0D%0A[/UnURL][!] > [/!]Content-type: application/x-www-form-urlencoded[unurl]%0D%0A[/UnURL][!] > [/!]Content-length:[!] > [/!][countchars][post_data][/CountChars][unurl]%0D%0A[/UnURL][!] [/!]Authorization: Basic [encrypt method=Base64][username]:[password][/encrypt][unurl]%0D%0A[/UnURL][!] > [/!][post_data][unurl]%0D%0A[/UnURL][!] [/!][unurl]%0D%0A[/UnURL][!] > [/!][/TCPSend] > [/tcpconnect] > > ------ End of Forwarded MessageNote that I made two changes. I added the Authorization: Basic line and I moved the double CR/LF to the end, after the [post_data]. The rules for HTTP requests are very specific: the request is terminated by two CR/LF pairs. The form post data must be followed by the two blank lines, not preceeded.Get yourself a copy of something like net.demon (Windows only) that allows you to see the actual HTTP request and response: http://www.netdemon.net/ HTHJohn-- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4720 Boston Way Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5747------------------------------------------------------------- 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 Web Archive of this list is at: http://search.smithmicro.com/ John Peacock

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:

Billing when shipped (2006) Help name our technology! (1997) Not really WebCat- (1997) About WebDNA (2006) Question (2000) Generating Report Totals (1997) Multiple ShipTo Addresses (2003) Store Admin Problems (1999) Google Web Accelerator (2005) Anyone integrate askimet with webdna? (2007) Re:2nd WebCatalog2 Feature Request (1996) [WebDNA] Append speed limits (2008) Kaaaaahhhhhhhnnnnnnn! (1997) READFILE command? (1998) [WebDNA] WebDNA trivia quiz (2013) Great product and great job ! (1997) [WebDNA] WebDNA Showcase? (2008) syntax question, not in online refernce (1997) Calculating Shipping (1997) 4.0 send email ticks. . (2000)