如何在Android上的Java上发出此请求?我也想找回答案
示例:
$ curl -X POST -H "cle: 780bf0421d7e962" -F "user_id=47554" -F "json=@/path/to/file.json" "https://www.visugpx.com/api/pushtrack"
response (header -> json) :
HTTP/1.0 400 Bad Request -> {"ERROR": "NO USER_ID"}
HTTP/1.0 400 Bad Request -> {"ERROR": "NO USER_KEY"}
HTTP/1.0 400 Bad Request -> {"ERROR": "NOT A VALID USER_KEY"}
HTTP/1.0 400 Bad Request -> {"ERROR": "NO JSON FILE"}
HTTP/1.0 400 Bad Request -> {"ERROR": "NOT A VALID JSON FILE"}
HTTP/1.0 500 Internal Server Error -> {"ERROR": "SERVER ERROR"}
HTTP/1.0 200 OK -> {"SUCCESS": {"id" = file_id}}