java - Android Connection not changing headers/request method -
given following code:
private httpsurlconnection buildconnection(final string urlstring) throws malformedurlexception, ioexception, protocolexception { final url url = new url(urlstring); final httpsurlconnection connection = (httpsurlconnection) url.openconnection(); connection.setrequestmethod("post"); connection.setusecaches(false); connection.setdoinput(true); connection.setdooutput(true); connection.setchunkedstreamingmode(0); return connection; }
why connection.method = "get"? calls addrequestproperty seems ignored, well.
this using android, android studio, on windows write code (thus using whatever classes downloads android sdk, should same else...)
i found problem debugging windows reason not updating. code changing variables in memory, debugging windows in android studio , eclipse failed reflect correct information.
my problem stemmed authorization header using capital instead of lowercase i, causing unauthorized returned , debugging information not reflecting correct information messed thought wrong, , led me down rabbit hole 2 days.
Comments
Post a Comment