Skip to content

Instantly share code, notes, and snippets.

@beders
Last active September 29, 2015 15:48
Show Gist options
  • Save beders/fa6bcf6f319fb858f151 to your computer and use it in GitHub Desktop.
Save beders/fa6bcf6f319fb858f151 to your computer and use it in GitHub Desktop.
Hello World! Complete example
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);
}
}
@skaffen2
Copy link

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.*;

@beders
Copy link
Author

beders commented Jun 14, 2015

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