use of com.github.dreamhead.moco.Request in project moco by dreamhead.
the class AbstractContentResponseHandler method writeToResponse.
@Override
public final void writeToResponse(final SessionContext context) {
Request request = context.getRequest();
Response response = context.getResponse();
if (HttpRequest.class.isInstance(request) && MutableHttpResponse.class.isInstance(response)) {
HttpRequest httpRequest = HttpRequest.class.cast(request);
MutableHttpResponse httpResponse = MutableHttpResponse.class.cast(response);
doWriteToResponse(httpRequest, httpResponse);
return;
}
MutableResponse mutableResponse = MutableResponse.class.cast(response);
mutableResponse.setContent(requireResponseContent(request));
}
use of com.github.dreamhead.moco.Request in project moco by dreamhead.
the class AbstractHttpResponseHandler method writeToResponse.
@Override
public final void writeToResponse(final SessionContext context) {
Request request = context.getRequest();
Response response = context.getResponse();
if (HttpRequest.class.isInstance(request) && MutableHttpResponse.class.isInstance(response)) {
HttpRequest httpRequest = HttpRequest.class.cast(request);
MutableHttpResponse httpResponse = MutableHttpResponse.class.cast(response);
doWriteToResponse(httpRequest, httpResponse);
}
}
Aggregations