0

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.

Thanks in advance.

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

user1534326
  • 115
  • 1
  • 2
  • 6

2 Answers2

1

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

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

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

Community
  • 1
  • 1
Leonel Machava
  • 1,501
  • 11
  • 19
  • Hello, thanks for your answer. But i tried it and it doesn't work. Maybe you can see what type of authencation is needed for this url: http://webservices.ns.nl/ns-api-avt?station=Utrecht – user1534326 Aug 31 '12 at 16:35
0

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

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

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

Community
  • 1
  • 1
Mehdi
  • 4,396
  • 4
  • 29
  • 30
  • Maybe this sounds stupid but i can't find it on the given link :P – user1534326 Aug 31 '12 at 16:27
  • this thread is about working with httpGet or httpPost. not exactly fits with your requirement for authentication but helps you to know how to work with httpGet or httpPost. – Mehdi Aug 31 '12 at 16:31