0
我想發送一個簡單的POST命令來上傳文件。我如何在android開發人員編寫代碼?代碼應提供以下POST請求請給出非常簡單的基本POST命令代碼android studio
POST /macros/s/AqtUErjtk/postform?no&func=uploadFiles HTTP/1.1
Host: xyz.website.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:54.0) Gecko/20100101 Firefox/54.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Content-Type: multipart/form-data; boundary=---------------------------236532717524914
Content-Length: 337
的Cookie:
NID=106=gWQeUVIa2phdDJeXYdRFSPTnsklPrFVRwphw3G685QYZlDiZz7NK5PoJVEd1FYL6IqYoJ9fEtVHf0sKBIHq1wD1xr
Connection: close
Upgrade-Insecure-Requests: 1
-----------------------------236532717524914
Content-Disposition: form-data; name="_1_myFile"; filename="textfile.txt"
Content-Type: text/plain
這裏是文本文件內容yoyoyoyoyoy ------------------- ---------- 236532717524914--
看看這個鏈接可以幫助你:https://community.particle.io/t/example-android-application-post-get/9355 – Dalton
非常感謝! – user8334568
你有成功嗎? :) – Dalton