I am trying make a request and get response from server. Here is my HttpGet request.
public static String getAddress() throws Exception {
final HttpGet get = new HttpGet("192.168.1.4:3000/api/1.0/geo/address/lookup");
}
My server side is written by ruby on rails.
routes.rb
map.with_options(:controller => "geo") do |geo|
geo.geo_lookup_address "/api/1.0/geo/address/lookup", :action => "lookup_address"
my controller is
class GeoController < ApiController
def lookup_address
puts "lookup"
end
end
my html is lookup_address.html.erb
<h1>GEO</h1>
When I type the address in browser(192.168.1.4:3000/api/1.0/geo/address/lookup) I see the result GEO, but when I use that in android application it doesn’t work I check and I have an exception on HttpGet request, but the problem is I can’t find out what’s execption exactly is.
is there any solution here?
Have you tried?
As I see in your question You missed
http://in your URL inHttpGet..Also don’t forget to add permission in your Application’s Manifest file,