This class represents a part or form item that was received within a multipart/form-data POST request.

Since

Servlet 3.0

Constructors

Methods

  • Returns the value of the specified mime header as a String. If the Part did not include a header of the specified name, this method returns null. If there are multiple headers with the same name, this method returns the first header in the part. The header name is case insensitive. You can use this method with any request header.

    Parameters

    • name: string

      a String specifying the header name

    Returns string

    a String containing the value of the requested header, or null if the part does not have a header of that name

  • Gets the header names of this Part.

    Some servlet containers do not allow servlets to access headers using this method, in which case this method returns null

    Any changes to the returned Collection must not affect this Part.

    Returns Collection<string>

    a (possibly empty) Collection of the header names of this Part

  • Gets the values of the Part header with the given name.

    Any changes to the returned Collection must not affect this Part.

    Part header names are case insensitive.

    Parameters

    • name: string

      the header name whose values to return

    Returns Collection<string>

    a (possibly empty) Collection of the values of the header with the given name