Skip to content

Android518-2017/topic12-03-net-HttpURLConnection-POST

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

week14-net-HttpsURLConnectionExample-POST

Sample code that opens an HTTP connection (socket) to a a website api over TLS so using HTTPS It needs an api key, an api appid POST data is constructed for the request, uses http://www.edamam.com api

n.b. HTTP POST is more secure as you do not expose data in the URL as you do with HTTP GET The app retrieves the JSON response which is displayed as text in the UI, normally this would be parsed and used otherwise in the UI.

Uses

  • ConnectivityManager and NetworkInfo
  • AsyncTask
  • URLEncoder
  • HttpURLConnection for POST
  • BufferedInputStream
  • ByteArrayOutputStream
  • DataOutputStream

app HttpUrlConnection

Use of logcat to watch the logging

adb logcat -s HttpURLPOST

About

Using Network I/O Check status & HttpURLConnection + POST

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 95.7%
  • Shell 4.3%