rest-assured/src/main/java/io/restassured/builder/MultiPartSpecBuilder.java
public MultiPartSpecBuilder header(String name, String value) {
        Validate.notEmpty(name, "Header name cannot be empty");
        Validate.notEmpty(value, "Header value cannot be empty");

        // Replace previous header if exists
        final Set<String> headerNames = headers.keySet();
        final String trimmedName = name.trim();
        for (String headerName : headerNames) {
            if (headerName.equalsIgnoreCase(trimmedName)) {
                headers.remove(headerName);
            }
        }
        // Put the name header in the header list
        headers.put(name, value);
        return this;
    }
public MultiPartSpecBuilder header(String name, String value) {
        Validate.notEmpty(name, "Header name cannot be empty");
        Validate.notEmpty(value, "Header value cannot be empty");

        // Replace previous header if exists
        final Set<String> headerNames = headers.keySet();
        final String trimmedName = name.trim();
        for (String headerName : headerNames) {
            if (headerName.equalsIgnoreCase(trimmedName)) {
                headers.remove(headerName);
            }
        }
        // Put the name header in the header list
        headers.put(name, value);
        return this;
    }
public MultiPartSpecBuilder header ( String name , String value ) { Validate . notEmpty ( name , "Header name cannot be empty" ) ; Validate . notEmpty ( value , "Header value cannot be empty" ) ; // Replace previous header if exists final Set < String > headerNames = headers . keySet ( ) ; final String trimmedName = name . trim ( ) ; for ( String headerName : headerNames ) { if ( headerName . equalsIgnoreCase ( trimmedName ) ) { headers . remove ( headerName ) ; } } // Put the name header in the header list headers . put ( name , value ) ; return this ; }
Add a header to this multipart specification.

@param name The name of the header
@param value The value of the header
@return An instance of MultiPartSpecBuilder
Add a header to this multipart specification .