Class HttpRequestAttachment

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

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

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

  • Constructor Details

    • HttpRequestAttachment

      public HttpRequestAttachment(String name, String url, String method, String body, String curl, Map<String,String> headers, Map<String,String> cookies)
      Creates an HTTP request attachment with the supplied values.
      Parameters:
      name - the display name or logical name to use
      url - the request URL or service method name
      method - the framework or Java method to inspect
      body - the attachment body
      curl - the curl
      headers - the headers
      cookies - the cookies
    • HttpRequestAttachment

      public HttpRequestAttachment(String name, String url, String method, String body, String curl, Map<String,String> headers, Map<String,String> cookies, Map<String,String> formParams)
      Creates an HTTP request attachment with the supplied values.
      Parameters:
      name - the display name or logical name to use
      url - the request URL or service method name
      method - the framework or Java method to inspect
      body - the attachment body
      curl - the curl
      headers - the headers
      cookies - the cookies
      formParams - the form params
  • Method Details

    • getUrl

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

      public String getMethod()
      Returns the method.
      Returns:
      the method
    • getBody

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

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

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

      public Map<String,String> getFormParams()
      Returns the form params.
      Returns:
      the form params
    • getCurl

      public String getCurl()
      Returns the curl.
      Returns:
      the curl
    • getName

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

      public String toString()
      Overrides:
      toString in class Object