private void setupAcceptHeader ( String action , Map < String , String > requestHeaders , Map < String , String > requestParameters ) { // validates whether to add headers for accept for serialization String serializeAcceptFormat = getSerializationResponseFormat ( ) ; if ( StringUtils . hasText ( serializeAcceptFormat ) && ! isDownload ( action ) && ! isDownloadPDF ( requestParameters ) ) { requestHeaders . put ( RequestElements . HEADER_PARAM_ACCEPT , ContentTypes . getContentType ( serializeAcceptFormat ) ) ; } if ( isDownloadPDF ( requestParameters ) ) { requestHeaders . put ( RequestElements . HEADER_PARAM_ACCEPT , ContentTypes . getContentType ( requestParameters . get ( RequestElements . REQ_PARAM_ENTITY_SELECTOR ) ) ) ; } }
Setup accept header depends from the semantic of the request