• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

"GET" from http

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am parsing content within html with a java program I wrote. Here are the links I'm using and the problem:

I use http fox or fiddler to see the web traffic so I can write it all into my java program....

The Link:

http://151.213.249.227/oncoreweb/search.aspx?bd=7%2F31%2F1975&ed=1%2F30%2F2011&n=BRACEWELL%20STEVEN%20H&bt=OR&d=1%2F30%2F2011&pt=-1&dt=ALL%20DOCUMENT%20TYPES&st=fullname


on that page on the right side you will see:

Create Export File

when you click on that, it tries to open a spread sheet, just cancel that. It's not the issue.

the web traffic for the "Create Export File" is 2 GET(s).The first one produces this info in HTTP Fox: :

00:34:53.220 0.099 1108 245 GET 200 application/octet-stream http://151.213.249.227/oncoreweb/Export.aspx

if you look at the content of the first GET (from HTTP Fox or fiddler console), it is basically the content for a .csv file. I want to read that content into a string or a buffer. There is one BIG problem..... I do not know how to work with GET(s). I have always been confronted with POST(s). I know how to deal with them in java, but I don't know how to access GET(s). I do see in the "Headers" tab ( request header) of HTTP Fox there is some stuff that might have to be dealt with, but I do not know how to write the code in java to deal with it.

linking to the first url then to http://151.213.249.227/oncoreweb/Export.aspx does not work (that was advice someone gave me).

Any help would be appreciated.
Tony






 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to become familiar with the java.net.URLConnection and HttpURLConnection classes in the standard Java library.

Note that URLConnection give you a getInputStream method to read the response body and HttpURLConnection give you methods to look at the response headers.

Bill


 
tony puglese
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks. Let me look into those methods and how I can use them.
 
Rancher
Posts: 4686
7
Mac OS X VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Before you go reinventing the wheel, have you looked at the Apache HTTPclient code for java? its easy to use, been throughly debugged, and is well documented. Free and open source.
 
I AM MIGHTY! Especially when I hold this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic