@ Override public Map < String , String > getRequestHeaders ( ) { Map < String , String > requestHeaders = super . getRequestHeaders ( ) ; if ( requestHeaders == null ) requestHeaders = new HashMap <> ( ) ; try { requestHeaders . put ( Request . REQUEST_ID , getMasterRequestId ( ) ) ; String httpMethod = getHttpMethod ( ) ; if ( "GET" . equals ( httpMethod ) ) requestHeaders . put ( "Accept" , "application/json" ) ; else requestHeaders . put ( "Content-Type" , "application/json" ) ; } catch ( ActivityException ex ) { logexception ( ex . getMessage ( ) , ex ) ; } return requestHeaders ; }
Overridden to append JSON headers .