Can I get request header info using SaxBuilder?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Can I get request header info using SaxBuilder?

  1. #1
    Join Date
    Mar 2009
    Posts
    2

    Can I get request header info using SaxBuilder?

    Hi, I've been using jdom SaxBuilder as a convenient way to get an xml response from an http request:

    String url = "http://somewhere.com/request?args=vals"
    SAXBuilder parser = new SAXBuilder();
    Document doc = parser.build(url);

    But as the request / response and parsing into xml is all done under the bonnet here, does anyone know if I can get hold of response header values that would be in the response object?

    Thanks

  2. #2
    Join Date
    Mar 2009
    Posts
    2
    I did it like this in the end

    SAXBuilder parser = new SAXBuilder();
    String url = "http://somewhere.com/request?args=vals"
    URL urlObj = new URL(url);
    URLConnection urlConnection = urlObj.openConnection();
    urlConnection.getHeaderField("Last-Modified");
    org.jdom.Document doc = parser.build(urlConnection.getInputStream());

Similar Threads

  1. EXE header Info
    By Alphadan in forum VB Classic
    Replies: 1
    Last Post: 12-29-2008, 08:22 AM
  2. Xindice query
    By nonolap in forum XML
    Replies: 0
    Last Post: 05-26-2005, 04:10 AM
  3. Replies: 0
    Last Post: 02-26-2002, 10:17 AM
  4. Replies: 10
    Last Post: 08-14-2000, 09:15 AM
  5. Replies: 0
    Last Post: 08-10-2000, 03:10 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center