Android Question GetResponse(JSON)

vdudukov

Member
Licensed User
Hello everyone.

I need a little help with httputils2.


I have username and password, and i must get response from server.
I am trying to understand all of this, but i need little help.

So somebody can help, I would appreciate it.

Thanks.


Request

Method

URL

GET

api/xxx/warehouses

HTTP Header params

Values


Basic Authorization


Response


[

{

"id": 6,

"name": "name",

"organizationName": "orgName",

"locationName": "locName",

"address": "A",

"city": "B"




Site url = https://sitexxxx.com/api/xxx
 

vdudukov

Member
Licensed User
job1.Username = "user"
job1.Password = "pass"

is used to set username and password for an area which is using basic-authentification (.htaccess and .htpasswd)

If the site has an API then you need to look into the API-Documentation what you need to do
Yes, it is basic authorization.
 

vdudukov

Member
Licensed User
Well i dont know enough about websites, but man who develop this site said that is basic authentification.o_O

Well what can i do then ?
 

NJDude

Expert
Licensed User
In order for this to work that site must have an API, otherwise you are wasting your time.
 

vdudukov

Member
Licensed User
Well he sent me only GET URL api/xxxx/warehouses
and HTTP header params values AUTHORIZATION, BASIC AUTHORIZATION
 

NJDude

Expert
Licensed User
Yes, but he needs to provide you more info, like how to login and the whole request to be sent to the API.
 

DonManfred

Expert
Licensed User
Or that's a form displayed because we made a POST and not a GET to the correct URL.
Mööööp... wrong... calling url?username=xxx&password=bla is a GET-Request not a POST request!

But you may right that this is probably the behaviour of this site
 

lemonisdead

Well-Known Member
Licensed User
Mööööp... wrong.
Unsure but right : admit the server asking for the full URL or replying with a page letting you understand you've made a POST. Ah ah :p
You are probably right (trying to find some solutions)
 
Top