Skip to content

Instantly share code, notes, and snippets.

@breedx2
Created May 1, 2014 16:26
Show Gist options
  • Save breedx2/8f1fffc2b7d9a913a78b to your computer and use it in GitHub Desktop.
Save breedx2/8f1fffc2b7d9a913a78b to your computer and use it in GitHub Desktop.
import spark.*;
public class Issue107 {
public static void main(String[] args) {
Spark.before(new Filter("/issue") {
@Override
public void handle(Request request, Response response) {
System.out.println("Filter sees sees body: '" + request.body() + "'");
}
});
Spark.post(new Route("/issue") {
@Override
public Object handle(Request request, Response response) {
System.out.println("Route sees body: '" + request.body() + "'");
return "";
}
});
}
}
@breedx2
Copy link
Author

breedx2 commented May 1, 2014

Run the above and then poke it with curl:

curl -i -X post --data 'test' http://localhost:4567/issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment