Permalink
Browse files

Removed payload for POST/PUT/DELETE responses.

Fixed wrong name in logging.
  • Loading branch information...
1 parent c0fbf72 commit b23224cfb1fc248dd897de33b71eb70bd8828f76 @mkovatsc mkovatsc committed Mar 20, 2012
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
@@ -87,19 +87,19 @@ public void handleRequest(Request request) {
public static void main(String[] args) {
- Log.setLevel(Level.WARNING);
+ Log.setLevel(Level.INFO);
Log.init();
// create server
try {
Endpoint server = new PlugtestServer();
- System.out.printf("ExampleServer listening on port %d.\n", server.port());
+ System.out.printf(PlugtestServer.class.getSimpleName()+" listening on port %d.\n", server.port());
} catch (SocketException e) {
- System.err.printf("Failed to create SampleServer: %s\n", e.getMessage());
+ System.err.printf("Failed to create "+PlugtestServer.class.getSimpleName()+": %s\n", e.getMessage());
System.exit(ERR_INIT_FAILED);
}
@@ -96,6 +96,7 @@ public void performPOST(POSTRequest request) {
// create new response
Response response = new Response(CodeRegistry.RESP_CREATED);
+ /*
StringBuilder payload = new StringBuilder();
payload.append(String.format("Type: %d (%s)\nCode: %d (%s)\nMID: %d",
@@ -122,6 +123,8 @@ public void performPOST(POSTRequest request) {
response.setPayload(payload.toString());
response.setContentType(MediaTypeRegistry.TEXT_PLAIN);
+ */
+
response.setLocationPath("/nirvana");
// complete the request
@@ -136,6 +139,7 @@ public void performPUT(PUTRequest request) {
// create new response
Response response = new Response(CodeRegistry.RESP_CHANGED);
+ /*
StringBuilder payload = new StringBuilder();
payload.append(String.format("Type: %d (%s)\nCode: %d (%s)\nMID: %d",
@@ -162,6 +166,7 @@ public void performPUT(PUTRequest request) {
response.setPayload(payload.toString());
response.setContentType(MediaTypeRegistry.TEXT_PLAIN);
+ */
// complete the request
request.respond(response);
@@ -175,6 +180,7 @@ public void performDELETE(DELETERequest request) {
// create new response
Response response = new Response(CodeRegistry.RESP_DELETED);
+ /*
StringBuilder payload = new StringBuilder();
payload.append(String.format("Type: %d (%s)\nCode: %d (%s)\nMID: %d",
@@ -197,6 +203,7 @@ public void performDELETE(DELETERequest request) {
response.setPayload(payload.toString());
response.setContentType(MediaTypeRegistry.TEXT_PLAIN);
+ */
// complete the request
request.respond(response);

0 comments on commit b23224c

Please sign in to comment.