basic-lib/src/main/java/com/streamsets/pipeline/stage/processor/http/HttpProcessor.java
private void writeResponseHeaderToField(Record record, Response response) throws StageException {
    if (record.has(conf.headerOutputField)) {
      throw new StageException(Errors.HTTP_11, conf.headerOutputField);
    }
    Map<String, Field> headers = new HashMap<>(response.getStringHeaders().size());

    for (Map.Entry<String, List<String>> entry : response.getStringHeaders().entrySet()) {
      if (!entry.getValue().isEmpty()) {
        String firstValue = entry.getValue().get(0);
        headers.put(entry.getKey(), Field.create(firstValue));
      }
    }

    record.set(conf.headerOutputField, Field.create(headers));
  }
private void writeResponseHeaderToField(Record record, Response response) throws StageException {
    if (record.has(conf.headerOutputField)) {
      throw new StageException(Errors.HTTP_11, conf.headerOutputField);
    }
    Map<String, Field> headers = new HashMap<>(response.getStringHeaders().size());

    for (Map.Entry<String, List<String>> entry : response.getStringHeaders().entrySet()) {
      if (!entry.getValue().isEmpty()) {
        String firstValue = entry.getValue().get(0);
        headers.put(entry.getKey(), Field.create(firstValue));
      }
    }

    record.set(conf.headerOutputField, Field.create(headers));
  }
private void writeResponseHeaderToField ( Record record , Response response ) throws StageException { if ( record . has ( conf . headerOutputField ) ) { throw new StageException ( Errors . HTTP_11 , conf . headerOutputField ) ; } Map < String , Field > headers = new HashMap <> ( response . getStringHeaders ( ) . size ( ) ) ; for ( Map . Entry < String , List < String > > entry : response . getStringHeaders ( ) . entrySet ( ) ) { if ( ! entry . getValue ( ) . isEmpty ( ) ) { String firstValue = entry . getValue ( ) . get ( 0 ) ; headers . put ( entry . getKey ( ) , Field . create ( firstValue ) ) ; } } record . set ( conf . headerOutputField , Field . create ( headers ) ) ; }
Writes HTTP response headers to the SDC Record at the configured field path.

@param record Record to populate with response headers.
@param response HTTP response
@throws StageException if the field path already exists
Writes HTTP response headers to the SDC Record at the configured field path .