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

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -