Created
August 24, 2017 17:01
-
-
Save johnbeadle/a39698577fb7074bd7c378160c65f08a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (this.postData != null) { | |
| OutputStreamWriter writer = new OutputStreamWriter(connection.getOutputStream()); | |
| Iterator<?> keys = postData.keys(); // get the object keys | |
| // loop through them | |
| while( keys.hasNext() ) { | |
| String key = (String)keys.next(); //get the postData key | |
| if ( postData.get(key) instanceof JSONObject ) { | |
| // do something else | |
| } else if( postData.get(key) instanceof String) { | |
| writer.write(key+"="+postData.get(key)+"&"); | |
| } | |
| } | |
| writer.flush(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment