lantunes / fixd

An HTTP Server Fixture for Testing HTTP Clients and mocking web services, and a Java Micro Web Framework
http://bigtesting.org/fixd
Apache License 2.0
41 stars 6 forks source link

Add support for accessing other request properties #2

Closed lantunes closed 10 years ago

lantunes commented 11 years ago

It should be possible to access other request properties, such as the method, request time, etc. For example:

server.handle(Method.GET, "/")
      .with(200, "text/plain", "Method: [request.method]");

Response resp = new AsyncHttpClient()
                .prepareGet("http://localhost:8080/")
                .execute()
                .get();

assertEquals("Method: GET", resp.getResponseBody().trim());
lantunes commented 10 years ago

These are the other request properties:

method requestTime path query major minor target