Android:访问安全的xml文件

时间:2022-12-01 11:18:42

I used a xml parser many times but the only thing now is the server where the xml file is stored asks for a username and password (i have them) but how do i login with a httpGet or httpPost.

我多次使用xml解析器,但现在唯一的事情是存储xml文件的服务器要求输入用户名和密码(我有它们),但我如何使用httpGet或httpPost登录。

Thanks in advance.

提前致谢。

(PS: The username and password are always the same)

(PS:用户名和密码总是一样的)

2 个解决方案

#1


1  

I think you need to know how to do HTTP Authentication in android.

我想你需要知道如何在android中进行HTTP身份验证。

Read this question. There you will learn how to do HTTP authentication in android.

阅读这个问题。在那里,您将学习如何在android中进行HTTP身份验证。

EDIT: Check here to see how to determine authetication type needed.

编辑:在此处查看如何确定所需的认证类型。

#2


0  

Using java.net.URLConnection is described very well in the following link by BalusC

在BalusC的以下链接中很好地描述了使用java.net.URLConnection

Using java.net.URLConnection to fire and handle HTTP requests

使用java.net.URLConnection来触发和处理HTTP请求

Following that thread you can easily send httpGet or httpPost and login to server.

在该线程之后,您可以轻松发送httpGet或httpPost并登录到服务器。

#1


1  

I think you need to know how to do HTTP Authentication in android.

我想你需要知道如何在android中进行HTTP身份验证。

Read this question. There you will learn how to do HTTP authentication in android.

阅读这个问题。在那里,您将学习如何在android中进行HTTP身份验证。

EDIT: Check here to see how to determine authetication type needed.

编辑:在此处查看如何确定所需的认证类型。

#2


0  

Using java.net.URLConnection is described very well in the following link by BalusC

在BalusC的以下链接中很好地描述了使用java.net.URLConnection

Using java.net.URLConnection to fire and handle HTTP requests

使用java.net.URLConnection来触发和处理HTTP请求

Following that thread you can easily send httpGet or httpPost and login to server.

在该线程之后,您可以轻松发送httpGet或httpPost并登录到服务器。