public void setHeader ( String header , String value ) { StringValidator . throwIfEmptyOrNull ( "header" , header ) ; StringValidator . throwIfEmptyOrNull ( "value" , value ) ; if ( headers == null ) { headers = new HashMap < String , String > ( ) ; } headers . put ( header , value ) ; }
Sets a request header with the given name and value . If a header with the specified name has already been set then the new value overwrites the current value .