android - java.io.FileNotFoundException: https://api.instagram.com/v1/media/search -


why following code

url url = new url(urlstr);  log.d(tag, "opening url " + url.tostring()); httpurlconnection urlconnection = (httpurlconnection) url.openconnection(); urlconnection.setrequestmethod("get"); urlconnection.setdoinput(true); urlconnection.setdooutput(true); urlconnection.connect(); string response = streamtostring(urlconnection.getinputstream()); 

always giving me following exception @ urlconnection.getinputstream()?

w/system.err(16253): java.io.filenotfoundexception: https://api.instagram.com/v1/media/search/access_token=1559619173.3c922fe.4fd71e26225a42a0a03fdd90ef8679a6?lat=48.858318956&lng=2.294427258&distance=500 w/system.err(16253):    @ com.android.okhttp.internal.http.httpurlconnectionimpl.getinputstream(httpurlconnectionimpl.java:186) w/system.err(16253):    @ com.android.okhttp.internal.http.httpsurlconnectionimpl.getinputstream(httpsurlconnectionimpl.java:246) w/system.err(16253):    @ br.com.dina.oauth.instagram.instagramapp$5.run(instagramapp.java:192) 

you should remove urlconnection.setdooutput(true); line because setdooutput method force post instagram api work method.

you can check issue.

https://github.com/thiagolocatelli/android-instagram-oauth/issues/2


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -