Created
May 1, 2014 16:26
-
-
Save breedx2/8f1fffc2b7d9a913a78b to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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 ""; | |
} | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run the above and then poke it with curl:
curl -i -X post --data 'test' http://localhost:4567/issue