android - How to add variable to link -


i using retrofit library , weather forecast openweatherapi.

i have this.

base url: http://api.openweathermap.org/data/2.5/

@get("weather?q=&units=&appid=" + api_key) call<weatherapi> getweathercity(@query("city") string city, @query("units") string units); 

but bad url (i not know how repair it) -

response{protocol=http/1.1, code=502, message=bad gateway, url=http://api.openweathermap.org/data/2.5/weather?q=&units=&appid=111111111111111111111111&city=&units=metric}

your problem in url. if break url down able see error.

so have main body of url:

http://api.openweathermap.org/data/2.5/weather

then first param

?q= havent added after =, first problem.

then:

&units= again nothing after =, next problem.

then:

&appid=111111111111111111111111 bit fine.

then:

&city= again nothing after =.

then:

&units=metric bit fine.

so problem not passing values parameters.


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -