• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

REST api

 
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've been searching the web but i cannot find a tutorial in how to call REST methods on a server.
Looking to integrate some geocoding and social network methods on my site. Anyone have any tip/tuts out there?
 
Marshal
Posts: 26909
82
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Those "REST" methods are just plain old HTTP requests. Much simpler than other forms of web service. We are doing geocoding where I work, we send the address to Google and (usually) get latitude and longitude back buried in an XML document. We use the Apache HttpClient software to do that and there's about 25 lines of code.
 
Joshua Elkino
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mind showing me an example? Are you using the javascript api? I want to do this on the server side since i dont trust js too much
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Accessing the Google Geocoder with Java is simple. Here is how to construct the URL.
Be aware that there's a throttle on how many requests you can make per minute (you'll get HTTP errors if you send too many) and per day (50000 if I remember correctly)
 
Joshua Elkino
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Joe,
I'm quite aware of the JavaScript methods to use gMaps, but i'm looking for a server side (JAVA) equivalent, thus my inquiry for how to call REST methods.

Lets take OpenSocial API as another example.. it can be called using JS, REST, and RPC... http://code.google.com/apis/opensocial/docs/index.html
how would i use their API?
 
Joshua Elkino
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well i finally found something simple!
http://developer.yahoo.com/java/howto-reqRestJava.html

Hope if anyone has a similar Q they can just look at this page for a simple example and modify it to work with their needs.
 
Joshua Elkino
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For a real example
 
reply
    Bookmark Topic Watch Topic
  • New Topic