Created
July 18, 2014 14:14
-
-
Save grimrose/0da9b4402ac85fbfec37 to your computer and use it in GitHub Desktop.
Groovy + Retrofitで http://weather.livedoor.com/weather_hacks/webservice を試してみる
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Grab(group = 'com.squareup.retrofit', module = 'retrofit', version = '1.6.1') | |
import retrofit.RestAdapter | |
import retrofit.http.GET | |
import retrofit.http.Query | |
interface WeatherService { | |
@GET('/forecast/webservice/json/v1') | |
Map find(@Query('city') String city) | |
} | |
def result = new RestAdapter.Builder() | |
.setEndpoint('http://weather.livedoor.com') | |
.build() | |
.create(WeatherService) | |
.find('400040') | |
println result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment