public Reader requestPost ( String data ) throws IOException { connection . setRequestMethod ( "POST" ) ; connection . setDoOutput ( true ) ; Writer writer = new Writer ( connection . getOutputStream ( ) ) ; writer . write ( data ) ; writer . close ( ) ; return new Reader ( connection . getInputStream ( ) ) ; }
Do a HTTP POST request forward specified URL and data string . Creates and return Reader object .