public final MessageBuilder header(String name,String value){
  JsoArray<Pair> headers=message.getHeaders();
  if (headers == null) {
    headers=JsoArray.create();
  }
  for (int i=0; i < headers.size(); i++) {
    Pair header=headers.get(i);
    if (name.equals(header.getName())) {
      header.setValue(value);
      return this;
    }
  }
  Pair header=Pair.create();
  header.setName(name);
  header.setValue(value);
  headers.add(header);
  message.setHeaders(headers);
  return this;
}

public final MessageBuilder header ( String name , String value ) { JsoArray < Pair > headers = message . getHeaders ( ) ; if ( headers == null ) { headers = JsoArray . create ( ) ; } for ( int i = 0 ; i < headers . size ( ) ; i ++ ) { Pair header = headers . get ( i ) ; if ( name . equals ( header . getName ( ) ) ) { header . setValue ( value ) ; return this ; } } Pair header = Pair . create ( ) ; header . setName ( name ) ; header . setValue ( value ) ; headers . add ( header ) ; message . setHeaders ( headers ) ; return this ; }
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 .
