ASP
  Home arrow ASP arrow Page 5 - HTTP Tunneling Revealed: Part 1/3
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP

HTTP Tunneling Revealed: Part 1/3
By: Adnan Masood
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 2 stars2 stars2 stars2 stars2 stars / 16
    2002-10-17

    Table of Contents:
  • HTTP Tunneling Revealed: Part 1/3
  • What is HTTP Tunneling?
  • More on iNET and XMLHTTP
  • ASPTear In Action
  • A ServerXMLHTTP Example
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    HTTP Tunneling Revealed: Part 1/3 - A ServerXMLHTTP Example


    (Page 5 of 6 )

    <%@ Page aspcompat=true %>
    <% Dim objXMLHTTP, xml, flightnumber, url
    '//Reading flight number from query string
    flightnumber=request("flightnumber")

    ' Create an Server xmlhttp object:
    xml = Server.CreateObject("MSXML2.ServerXMLHTTP")
    url = "http://shop.baa.co.uk/cgi-bin/ncommerce3/ExecMacro/flights/arrivals.d2w/report ?flightnumber="&cstr(flightnumber)&"&comingfrom=& hour=Hour&min=Min& hourselect=0&minselect=0& airport=LHR&timeframe=& terminalselect=0&terminal=All"
    ' Opens the connection to the remote server.
    xml.Open ("GET", url, False)

    ' Actually Sends the request and returns the data:
    xml.Send
    Response.Write ("<h1>This is generated results from BAA using Server XMLHTTP </h1>") Response.Write (xml.responseText)
    xml = Nothing
    %>


    Depicting BAA's GET Request Results for flight info

    Handling POST requests using ServerXMLHTTP
    It's quite simple to do POST requests to remote web sites. I demonstrate below how to query www.imdb.com (Internet Movie Database) for "My big fat Greek wedding", one of the most hilarious comedies of the year:

    <%@ Page aspcompat=true Debug="true"%>
    <%
    Dim objXMLHTTP, xml, flightnumber, url
    ' Create an Server xmlhttp object:
    xml = Server.CreateObject("MSXML2.ServerXMLHTTP")
    url = cstr("http://www.imdb.com/Find")
    xml.Open ("POST", url , False)
    xml.Send ("select=All&for=My big fat Greek wedding")
    Response.Write ("<h1>This is generated results from IMDB using Server XMLHTTP </h1>")
    Response.Write (xml.responseText)
    xml = Nothing
    %>


    POST Results from IMDB

    This is almost the same as get, however the Open method argument was replaced with POST, and the send method now includes POST data.

    The syntax for data via post is the same as a query string, but the question mark "?" used to signify the start of the URL query string is now eliminated.

    More ASP Articles
    More By Adnan Masood


     

    ASP ARTICLES

    - Central Scoreboard with Flash and ASP
    - Calorie Counter Using WAP and ASP
    - Creating PGP-Encrypted E-Mails Using ASP
    - Be My Guest in ASP
    - Session Replacement in ASP
    - Securing ASP Data Access Credentials Using t...
    - The Not So Ordinary Address Book
    - Adding and Displaying Data Easily via ASP an...
    - Sending Email From a Form in ASP
    - Adding Member Services in ASP
    - Removing Unconfirmed Members
    - Trapping HTTP 500.100 - Internal Server Error
    - So Many Rows, So Little Time! - Case Study
    - XDO: An XML Engine Class for Classic ASP
    - Credit Card Fraud Prevention Using ASP and C...







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek