我试图做一个web服务发布请求,其实我可以在终端做$ curl -X POST -H "Content-Type: application/json" -d '{"username":"root","password":"8246"}' https://192.168.1.5:8000/token/ --insecure
并获得一个身份验证令牌响应,但..我怎么能用android studio来做到这一点?,我看过很多示例代码下载的东西,但我想在我的RESTful服务中对用户进行身份验证。 谢谢Http发布到服务器json与android
我已经尝试httpconnection,但现在已被android工作室弃用,我不能找到如何正确使用okhttp,如果你有一个例子或什么将是伟大的!
谢谢,生病尝试 –
顺便说一句,恕我直言AsynHttpClient将是最容易使用。 – FWeigl
我使用[Retrofit2](http://square.github.io/retrofit/),它运行得更好,尤其是访问https检查[vogella]上的示例(http://www.vogella.com/tutorials/Retrofit/ article.html) – Dun0523