【发布时间】:2018-11-06 20:23:39
【问题描述】:
我已经在 Rails 中构建了我的后端。 我的电子邮件地址是“sample@zmail.com”,并且已经注册。这里的密码是“28902890”
在终端输入以下命令后
curl -v -H 'Content-Type: application/json' -H 'Accept: application/json' -X POST https://auth-agdit.herokuapp.com/api/v1/sessions -d "{\"user\":{\"email\":\"sample@zmail\",\"password\":\"28902890\"}}"
我从后端收到此响应,
{"success":true,"info":"Logged in :) ","data":{"authentication_token":"iexGFwJ6HwERQZ3wJ4NG"}}
现在我需要从我的 Android 应用中获取这些数据。 对于不需要身份验证且请求方法为 GET 的简单 json,我可以使用 WebClient().downloadString() 方法获取 json。
现在我需要为 POST 方法获取输出 Json。 我怎样才能做到这一点?
【问题讨论】:
标签: c# android xamarin xamarin.android