Vivek Patel
Vivek Patel

Reputation: 419

cannot assign port in url while requesting to server in android

i am creating android app where i need to pass url with port as "http://182.71.155142:8888" but when i request for this url from android app using loopj Library .It shows me exception and Exception is:

Unable to resolve host "nsg-static-142.155.71.182.airtel.in": No address associated with hostname

Can anyone help me how to pass port number so that i can get response from url

i am sending the request by using following code:

AsyncHttpClient client = new AsyncHttpClient(8888); client.get("http://182.71.155.142/demo/loan-lelo/json/1",params,new AsyncHttpResponseHandler()

i am able to hit url from browser and getting response by this way i am hitting url "http://182.71.155.142:8888/demo/loan-lelo/json/loan-details/1"

Upvotes: 0

Views: 99

Answers (1)

Preetika Kaur
Preetika Kaur

Reputation: 2031

Try using any other library. I tried with OKHttp Library and works properly for me in my case.

Upvotes: 1

Related Questions