@@ -400,7 +400,7 @@ default MediaType accept(@Nonnull List<MediaType> produceTypes) {
400400 *
401401 * @return Request <code>Content-Type</code> header or <code>null</code> when missing.
402402 */
403- @ Nullable default MediaType getContentType () {
403+ @ Nullable default MediaType getRequestType () {
404404 Value contentType = header ("Content-Type" );
405405 return contentType .isMissing () ? null : MediaType .valueOf (contentType .value ());
406406 }
@@ -411,7 +411,7 @@ default MediaType accept(@Nonnull List<MediaType> produceTypes) {
411411 * @param defaults Default content type to use when the header is missing.
412412 * @return Request <code>Content-Type</code> header or <code>null</code> when missing.
413413 */
414- @ Nonnull default MediaType getContentType (MediaType defaults ) {
414+ @ Nonnull default MediaType getRequestType (MediaType defaults ) {
415415 Value contentType = header ("Content-Type" );
416416 return contentType .isMissing () ? defaults : MediaType .valueOf (contentType .value ());
417417 }
@@ -421,7 +421,7 @@ default MediaType accept(@Nonnull List<MediaType> produceTypes) {
421421 *
422422 * @return Request <code>Content-Length</code> header or <code>-1</code> when missing.
423423 */
424- default long getContentLength () {
424+ default long getRequestLength () {
425425 Value contentLength = header ("Content-Length" );
426426 return contentLength .isMissing () ? -1 : contentLength .longValue ();
427427 }
@@ -671,7 +671,7 @@ default long getContentLength() {
671671 * @return Instance of conversion type.
672672 */
673673 default @ Nonnull <T > T body (@ Nonnull Reified <T > type ) {
674- return body (type , getContentType (MediaType .text ));
674+ return body (type , getRequestType (MediaType .text ));
675675 }
676676
677677 /**
@@ -698,7 +698,7 @@ default long getContentLength() {
698698 * @return Instance of conversion type.
699699 */
700700 default @ Nonnull <T > T body (@ Nonnull Class type ) {
701- return body (type , getContentType (MediaType .text ));
701+ return body (type , getRequestType (MediaType .text ));
702702 }
703703
704704 /**
@@ -863,24 +863,24 @@ default long getContentLength() {
863863 * @param length Response length.
864864 * @return This context.
865865 */
866- @ Nonnull Context setContentLength (long length );
866+ @ Nonnull Context setResponseLength (long length );
867867
868868 /**
869869 * Set response content type header.
870870 *
871871 * @param contentType Content type.
872872 * @return This context.
873873 */
874- @ Nonnull Context setContentType (@ Nonnull String contentType );
874+ @ Nonnull Context setResponseType (@ Nonnull String contentType );
875875
876876 /**
877877 * Set response content type header.
878878 *
879879 * @param contentType Content type.
880880 * @return This context.
881881 */
882- @ Nonnull default Context setContentType (@ Nonnull MediaType contentType ) {
883- return setContentType (contentType , contentType .getCharset ());
882+ @ Nonnull default Context setResponseType (@ Nonnull MediaType contentType ) {
883+ return setResponseType (contentType , contentType .getCharset ());
884884 }
885885
886886 /**
@@ -890,7 +890,7 @@ default long getContentLength() {
890890 * @param charset Charset.
891891 * @return This context.
892892 */
893- @ Nonnull Context setContentType (@ Nonnull MediaType contentType , @ Nullable Charset charset );
893+ @ Nonnull Context setResponseType (@ Nonnull MediaType contentType , @ Nullable Charset charset );
894894
895895 /**
896896 * Set the default response content type header. It is used if the response content type header
@@ -899,14 +899,14 @@ default long getContentLength() {
899899 * @param contentType Content type.
900900 * @return This context.
901901 */
902- @ Nonnull Context setDefaultContentType (@ Nonnull MediaType contentType );
902+ @ Nonnull Context setDefaultResponseType (@ Nonnull MediaType contentType );
903903
904904 /**
905905 * Get response content type.
906906 *
907907 * @return Response content type.
908908 */
909- @ Nonnull MediaType getResponseContentType ();
909+ @ Nonnull MediaType getResponseType ();
910910
911911 /**
912912 * Set response status code.
@@ -965,7 +965,7 @@ default long getContentLength() {
965965 * @return HTTP channel as output stream. Usually for chunked responses.
966966 */
967967 default @ Nonnull OutputStream responseStream (@ Nonnull MediaType contentType ) {
968- setContentType (contentType );
968+ setResponseType (contentType );
969969 return responseStream ();
970970 }
971971
@@ -979,7 +979,7 @@ default long getContentLength() {
979979 */
980980 default @ Nonnull Context responseStream (@ Nonnull MediaType contentType ,
981981 @ Nonnull Throwing .Consumer <OutputStream > consumer ) throws Exception {
982- setContentType (contentType );
982+ setResponseType (contentType );
983983 return responseStream (consumer );
984984 }
985985
@@ -1169,9 +1169,9 @@ default long getContentLength() {
11691169 InputStream content = file .stream ();
11701170 long length = file .getFileSize ();
11711171 if (length > 0 ) {
1172- setContentLength (length );
1172+ setResponseLength (length );
11731173 }
1174- setDefaultContentType (file .getContentType ());
1174+ setDefaultResponseType (file .getContentType ());
11751175 if (content instanceof FileInputStream ) {
11761176 sendFile (((FileInputStream ) content ).getChannel ());
11771177 } else {
@@ -1188,7 +1188,7 @@ default long getContentLength() {
11881188 */
11891189 default @ Nonnull Context sendFile (@ Nonnull Path file ) {
11901190 try {
1191- setDefaultContentType (MediaType .byFile (file ));
1191+ setDefaultResponseType (MediaType .byFile (file ));
11921192 return sendFile (FileChannel .open (file ));
11931193 } catch (IOException x ) {
11941194 throw Throwing .sneakyThrow (x );
0 commit comments