# pamqp.header

AMQP Header Class Definitions

For encoding AMQP Header frames into binary AMQP stream data and decoding AMQP binary data into AMQP Header frames.

class pamqp.header.ProtocolHeader(major_version: int = 0, minor_version: int = 9, revision: int = 1)

  Class that represents the AMQP Protocol Header

  marshal() → bytes

    Return the full AMQP wire protocol frame data representation of the ProtocolHeader frame.

  unmarshal(data: bytes) → int

    Dynamically decode the frame data applying the values to the method object by iterating through the attributes in order and decoding them.

    Parameters:

      data – The frame value to unpack

    Raises:

      ValueError

class pamqp.header.ContentHeader(weight: int = 0, body_size: int = 0, properties: Properties | None = None)

  Represent a content header frame

  A Content Header frame is received after a Basic.Deliver or Basic.GetOk frame and has the data and properties for the Content Body frames that follow.

  marshal() → bytes

    Return the AMQP binary encoded value of the frame

  unmarshal(data: bytes) → None

    Dynamically decode the frame data applying the values to the method object by iterating through the attributes in order and decoding them.

    Parameters:

      data – The raw frame data to unmarshal