Pushbullet API via http in Android -
how can receive pushbullet notes/images/profile details via api-key on android? main problem ssl security in point. (btw: i'm pretty beginner in android , know basics.)
the auth looks this:
https://apikey@api.pushbullet.com/v2/users/me
i'm requesting content of webpage (e.g. wikipedia.org) via
try { url url = new url("https://www.wikipedia.org"); urlconnection urlconnection = url.openconnection(); inputstream in = urlconnection.getinputstream(); stringwriter writer = new stringwriter(); ioutils.copy(in, writer); thestring = writer.tostring(); textview.settext(thestring); } catch (exception e) { textview.settext("error: "+e "string content: " +thestring); }
but when i'm requesting, example, profile details i'm getting a
javaio filenotfoundexception
if run requests through https://www.runscope.com can see request client making (they have free plan trying out).
if had guess it's authorization not working correctly. able page using curl? should like:
curl -u <apikey>: https://api.pushbullet.com/v2/users/me
assuming works, try like
urlconnection.setrequestproperty("authorization", "bearer <apikey>");
or set headers on http requests. more explicit relying on https://password@domain url thing.