Class Message

java.lang.Object
org.netpreserve.jwarc.Message
Direct Known Subclasses:
GeminiResponse, HttpMessage, WarcRecord

public abstract class Message extends Object
A message consisting of headers and a content block (body). Forms the basis of protocols and formats like HTTP and WARC.
  • Method Details

    • headers

      public MessageHeaders headers()
      The named header fields of this message.
    • body

      public MessageBody body()
      The content body of this message.
    • version

      public MessageVersion version()
      The version of the network protocol or file format containing this message.
    • contentType

      public MediaType contentType()
      The media type of the body.

      Returns "application/octet-stream" if the Content-Type header is missing.

    • serializeHeader

      public byte[] serializeHeader()
      Serializes the message header.