HttpURLConnection, how to sending parameters via post?

前端 未结 2 640
予麋鹿
予麋鹿 2021-01-29 04:52
    String pathToOurFile = \"/sdcard/DCIM/Camera/foto.jpg\";
    String urlServer = \"http://server/upload.php\";        
    String lineEnd = \"\\r\\n\";
    String two         


        
2条回答
  •  日久生厌
    2021-01-29 05:17

    I found this blog useful for writing some multipart form data code:
    http://blog.rafaelsanches.com/2011/01/29/upload-using-multipart-post-using-httpclient-in-android/

    Don't forget to change the boundary variable to match what you specify in the HttpURLConnection that you're using to send the multipart form to the server.

提交回复
热议问题