Android HttpURLConnection not working with cgi-bin? -
i have simple code :
url url; bufferedreader in = null; httpurlconnection connection; inputstream = null; inputstreamreader br = null; setprogresstitle(progress, context.getstring(r.string.loading)); setprogressmessage(progress, context.getstring(r.string.loading_from_internet)); try { url = new url(urlstr); connection = (httpurlconnection) url.openconnection(); connection.setconnecttimeout(const.timeout); = connection.getinputstream(); ...
if have urlstr = "http://samlib.ru/w/waliduda_a_a/molochnischituran1.shtml" - work fine. if use urls urlstr = "http://samlib.ru/cgi-bin/areader?q=jlist" - got error in connection.getinputstream();
** 03-04 15:37:52.459: error/datareader::loaddatafrominet(17281): failed loading http://samlib.ru/cgi-bin/areader?q=jlist 03-04 15:37:52.459: error/datareader::loaddatafrominet(17281): java.io.filenotfoundexception: http://samlib.ru/cgi-bin/areader?q=jlist 03-04 15:37:52.459: error/datareader::loaddatafrominet(17281): @ org.apache.harmony.luni.internal.net.www.protocol.http.httpurlconnectionimpl.getinputstream(httpurlconnectionimpl.java:521) **
how can upload data similar url?
there couple of reasons might happen. i've seen when i've put in url subsequently redirected, httpurlconnection doesn't handle that. got same response you, hit ff , works fine. possible sort of browser sniffing might done on recieving side.
good luck!
Comments
Post a Comment