can not get InputStream
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   fellow_ls
Posted On:   Friday, May 28, 2004 12:21 AM

My code can not get InputStream from a website, which request is(this is the value of _url in my program): http://jobs.workopolis.com/jobshome/db/work.process_job?pi_language=EN&pi_sort_col=+&pi_category=Dummy&pi_industry=Dummy&pi_employer=Dummy&pi_location=Dummy&pi_msg=&pi_location=British Columbia&pi_keyword=account but the response in Internet Browser is: http://jobs.workopolis.com/jobshome/db/work.res_list?pi_sort_col=POST_DATE&pi_search_id=383061735&pi_msg=+&pi_page_no=2&pi_page_id= My code is following: public void openReader(String _url){ try{ url= new URL(WebUtil.addHttp(_url))   More>>

My code can not get InputStream from a website, which request is(this is the value of _url in my program):


http://jobs.workopolis.com/jobshome/db/work.process_job?pi_language=EN&pi_sort_col=+&pi_category=Dummy&pi_industry=Dummy&pi_employer=Dummy&pi_location=Dummy&pi_msg=&pi_location=British Columbia&pi_keyword=account


but the response in Internet Browser is:

http://jobs.workopolis.com/jobshome/db/work.res_list?pi_sort_col=POST_DATE&pi_search_id=383061735&pi_msg=+&pi_page_no=2&pi_page_id=

My code is following:

public void openReader(String _url){

try{

url= new URL(WebUtil.addHttp(_url));

HttpURLConnection.setFollowRedirects(true);

con= (HttpURLConnection) url.openConnection();

java.io.InputStream uc= con.getInputStream();

br= new BufferedReader(new InputStreamReader(uc));

}catch (Exception ex) { ex.printStackTrace(); return; }

}


Anyone has an idea to solve the problem?
Thank you very much for any input!

Shawn

   <<Less

Re: can not get InputStream

Posted By:   Sean_Owen  
Posted On:   Friday, May 28, 2004 07:50 AM

I think you need to say more about the problem than "can not get an input stream". What fails? what exception? Also, what do you mean about the browser response? isn't this in a Java program?
About | Sitemap | Contact