Class HttpResponseAttachment

java.lang.Object
io.qameta.allure.attachment.http.HttpResponseAttachment
All Implemented Interfaces:
AttachmentData

public class HttpResponseAttachment extends Object implements AttachmentData
Describes an HTTP or RPC response attachment rendered in an Allure report.

Use this model to carry response metadata and body content from client interceptors to attachment renderers and processors.

  • Constructor Details

    • HttpResponseAttachment

      public HttpResponseAttachment(String name, String url, String body, int responseCode, Map<String,String> headers, Map<String,String> cookies)
      Creates an HTTP response attachment with the supplied values.
      Parameters:
      name - the display name or logical name to use
      url - the request URL or service method name
      body - the attachment body
      responseCode - the response code
      headers - the headers
      cookies - the cookies
  • Method Details

    • getName

      public String getName()
      Returns the name.
      Specified by:
      getName in interface AttachmentData
      Returns:
      the attachment or display name
    • getUrl

      public String getUrl()
      Returns the url.
      Returns:
      the url
    • getBody

      public String getBody()
      Returns the body.
      Returns:
      the body
    • getResponseCode

      public int getResponseCode()
      Returns the response code.
      Returns:
      the response code
    • getHeaders

      public Map<String,String> getHeaders()
      Returns the headers.
      Returns:
      the headers
    • getCookies

      public Map<String,String> getCookies()
      Returns the cookies.
      Returns:
      the cookies
    • toString

      public String toString()
      Overrides:
      toString in class Object