private void prepareDataServiceRequest(IntuitMessage intuitMessage, RequestElements requestElements, Map<String, String> requestParameters,
			String action) throws FMSException {
		requestParameters.put(RequestElements.REQ_PARAM_RESOURCE_URL,
				getUri(intuitMessage.isPlatformService(), action, requestElements.getContext(), requestParameters, intuitMessage.isEntitlementService()));

		Map<String, String> requestHeaders = requestElements.getRequestHeaders();

		if (isUpload(action)) {
			prepareUploadParams(requestElements);
		} else if (StringUtils.hasText(requestElements.getPostString())) {
			// if postString exists which means that the content-type should be text and serialization is not required
			requestHeaders.put(RequestElements.HEADER_PARAM_CONTENT_TYPE, ContentTypes.TEXT.toString());
		} else {
			// validates whether to add headers for content-type for serialization
			String serializeFormat = getSerializationRequestFormat();
            // add content type, except POST queries with email ("<entity>/id/send?...") - it has no POST body
			if (StringUtils.hasText(serializeFormat) && !isSendEmail(requestParameters)) {
				requestHeaders.put(RequestElements.HEADER_PARAM_CONTENT_TYPE, ContentTypes.getContentType(serializeFormat));
			} 
			else if (StringUtils.hasText(serializeFormat) && isSendEmail(requestParameters)) {
				requestHeaders.put(RequestElements.HEADER_PARAM_CONTENT_TYPE, ContentTypes.OCTECT_STREAM.toString());
			}
		}

		// validates whether to add headers for content-encoding for compression
		String compressFormat = Config.getProperty(Config.COMPRESSION_REQUEST_FORMAT);
		if (StringUtils.hasText(compressFormat) && CompressorFactory.isValidCompressFormat(compressFormat)) {
			requestHeaders.put(RequestElements.HEADER_PARAM_CONTENT_ENCODING, compressFormat);
		}

        setupAcceptEncoding(requestHeaders);
        setupAcceptHeader(action, requestHeaders, requestParameters);


        UUID trackingID = requestElements.getContext().getTrackingID();
		if(!(trackingID==null))
		{
			requestHeaders.put(RequestElements.HEADER_INTUIT_TID, trackingID.toString());
		}
	}
private void prepareDataServiceRequest ( IntuitMessage intuitMessage , RequestElements requestElements , Map < String , String > requestParameters , String action ) throws FMSException { requestParameters . put ( RequestElements . REQ_PARAM_RESOURCE_URL , getUri ( intuitMessage . isPlatformService ( ) , action , requestElements . getContext ( ) , requestParameters , intuitMessage . isEntitlementService ( ) ) ) ; Map < String , String > requestHeaders = requestElements . getRequestHeaders ( ) ; if ( isUpload ( action ) ) { prepareUploadParams ( requestElements ) ; } else if ( StringUtils . hasText ( requestElements . getPostString ( ) ) ) { requestHeaders . put ( RequestElements . HEADER_PARAM_CONTENT_TYPE , ContentTypes . TEXT . toString ( ) ) ; } else { String serializeFormat = getSerializationRequestFormat ( ) ; if ( StringUtils . hasText ( serializeFormat ) && ! isSendEmail ( requestParameters ) ) { requestHeaders . put ( RequestElements . HEADER_PARAM_CONTENT_TYPE , ContentTypes . getContentType ( serializeFormat ) ) ; } else if ( StringUtils . hasText ( serializeFormat ) && isSendEmail ( requestParameters ) ) { requestHeaders . put ( RequestElements . HEADER_PARAM_CONTENT_TYPE , ContentTypes . OCTECT_STREAM . toString ( ) ) ; } } String compressFormat = Config . getProperty ( Config . COMPRESSION_REQUEST_FORMAT ) ; if ( StringUtils . hasText ( compressFormat ) && CompressorFactory . isValidCompressFormat ( compressFormat ) ) { requestHeaders . put ( RequestElements . HEADER_PARAM_CONTENT_ENCODING , compressFormat ) ; } setupAcceptEncoding ( requestHeaders ) ; setupAcceptHeader ( action , requestHeaders , requestParameters ) ; UUID trackingID = requestElements . getContext ( ) . getTrackingID ( ) ; if ( ! ( trackingID == null ) ) { requestHeaders . put ( RequestElements . HEADER_INTUIT_TID , trackingID . toString ( ) ) ; } }
Method to prepare request parameters for data service

@param intuitMessage
the intuit message
@param requestElements
the request elements
@param requestParameters
the request parameters
@param action
the action type
@throws FMSException
the FMS Exception
@throws CompressionException
the Compression Exception