@@ -151,11 +151,11 @@ default boolean accept(MediaType contentType) {
151151 return contentType .matches (accept );
152152 }
153153
154- @ Nonnull default MediaType contentType () {
154+ @ Nonnull default MediaType requestType () {
155155 return header ("Content-Type" ).toOptional ().map (MediaType ::valueOf ).orElse (null );
156156 }
157157
158- default long contentLength () {
158+ default long requestLength () {
159159 return header ("Content-Length" ).longValue (-1 );
160160 }
161161
@@ -307,11 +307,11 @@ default long contentLength() {
307307
308308 @ Nonnull Context detach (@ Nonnull Runnable action );
309309
310- @ Nullable <T > T get (String name );
310+ @ Nullable <T > T attribute (String name );
311311
312- @ Nonnull Context set (@ Nonnull String name , @ Nonnull Object value );
312+ @ Nonnull Context attribute (@ Nonnull String name , @ Nonnull Object value );
313313
314- @ Nonnull Map <String , Object > locals ();
314+ @ Nonnull Map <String , Object > attributes ();
315315
316316 /**
317317 * **********************************************************************************************
@@ -345,6 +345,8 @@ default long contentLength() {
345345 return responseType (contentType , contentType .charset ());
346346 }
347347
348+ @ Nonnull Context defaultResponseType (@ Nonnull MediaType contentType );
349+
348350 @ Nonnull Context responseType (@ Nonnull MediaType contentType , @ Nullable Charset charset );
349351
350352 @ Nonnull MediaType responseType ();
@@ -367,6 +369,17 @@ default long contentLength() {
367369
368370 @ Nonnull OutputStream responseStream ();
369371
372+ default @ Nonnull OutputStream responseStream (MediaType contentType ) {
373+ responseType (contentType );
374+ return responseStream ();
375+ }
376+
377+ default @ Nonnull Context responseStream (MediaType contentType ,
378+ Throwing .Consumer <OutputStream > consumer ) throws Exception {
379+ responseType (contentType );
380+ return responseStream (consumer );
381+ }
382+
370383 default @ Nonnull Context responseStream (Throwing .Consumer <OutputStream > consumer )
371384 throws Exception {
372385 try (OutputStream out = responseStream ()) {
0 commit comments