public HttpRequest withHeader ( String header , String value ) { if ( Strings . isValid ( header ) ) { if ( Strings . isValid ( value ) ) { headers . put ( header , value ) ; } else { withoutHeader ( header ) ; } } return this ; }
Sets the value of the given header replacing whatever was already in there ; if the value is null or empty the header is dropped altogether .