Last active
September 29, 2015 15:48
-
-
Save beders/fa6bcf6f319fb858f151 to your computer and use it in GitHub Desktop.
Hello World! Complete example
This file contains 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
import us.monoid.web.Resty; | |
import java.io.IOException; | |
public class HelloResty { | |
// Hello World! | |
public static void main(String... args) throws IOException { | |
Resty r = new Resty(); | |
// Get the content of the URL as text and print it | |
String hello = r.text("http://www.helloworld.org/data/helloworld.java").toString(); | |
System.out.println(hello); | |
} | |
} |
I turned it into a working example.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use these two import statements. Hello world should really show the full file otherwise its not very helpful.
import us.monoid.web.Resty;
import static us.monoid.web.Resty.*;