access rest api within controller

  • add following as dependency in build.gradle
    • compile ‘org.grails:grails-datastore-rest-client:5.0.0.RC2’
  • within controller
    • import grails.plugins.rest.client.RestBuilder
    • def rest = new grails.plugins.rest.client.RestBuilder()
      def resp =rest.get(ipUrl+ipAddr)
Advertisements
This entry was posted in Grails. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s