Android的 - 基于表单的身份验证 [英] Android - Form based authentication

查看:135
本文介绍了Android的 - 基于表单的身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要上传在网站上的一些数据,使用POST请求。我知道使用HTTP客户端执行POST请求

I need to upload some data on a site, using a POST request. I know to use HTTP client to execute a POST request

问题是,为了做到这一点,你应该先进行身份验证。结果
该网站是一个简单的页面提示输入用户名和密码。我认为它存储在浏览器中的cookie,并检查后续请求,看看是否我已经验证。结果
但我没有一个具体的想法如何实现这在Android上。

The problem is that in order to do this, you should authenticate first.
The site is a simple page prompting for a username and a password. I assume it stores a cookie in the browser and checks subsequent requests to see if I'm already authenticated.
But I don't have a concrete idea how to implement this on Android.

客户端只是给了我这样的:结果
网址上传: http://xyz.com/?page=add 结果
证书:行政/管理结果
数据格式:

The client just gave me this:
URL to upload: http://xyz.com/?page=add
Credentials: admin/admin
Format of data:

$_POST = {
  ["Name"]=>string(255)
  ["Address"]=>string(255)
  ["ZIP"]=>string(50)
  ["City"]=>string(100)
  ["Phone"]=>string(50)
  ["Email"]=>string(50)
  ["Age"]=>int(11)
  ["Validation_Result"]=>string(255)
  ["Comment"]=>string(-)
}
$_FILES["Image"] = {
    ["name"]=>string "3D-graphics_3D_Triangles_006790_.jpg"
    ["type"]=>string "image/jpeg"
    ["tmp_name"]=>string "C:\Windows\Temp\php1362.tmp"
    ["error"]=>int(0)
    ["size"]=>int
}

而不是其他。

能否请你点我在正确的方向我怎么会去这样做?

Could you please point me in the right direction how I would go about doing this?

推荐答案

如何在android系统做HTTP认证?

看看在这个问题上的答案。很能说明问题。

Check out the top answer on this question. Very good explanation.

这篇关于Android的 - 基于表单的身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆