public FinishRequest toFinishRequest ( boolean includeHeaders ) { if ( includeHeaders ) { return new FinishRequest ( body , copyHeaders ( headers ) , statusCode ) ; } else { String mime = null ; if ( body != null ) { mime = "text/plain" ; if ( headers != null && ( headers . containsKey ( "Content-Type" ) || headers . containsKey ( "content-type" ) ) ) { mime = headers . get ( "Content-Type" ) ; if ( mime == null ) { mime = headers . get ( "content-type" ) ; } } } return new FinishRequest ( body , mime , statusCode ) ; } }
Convert the message to a FinishRequest