Class HttpInteraction

java.lang.Object
com.easypost.easyvcr.requestelements.HttpElement
com.easypost.easyvcr.requestelements.HttpInteraction

public final class HttpInteraction extends HttpElement
Represents an HTTP request-response pair tracked by EasyVCR.
  • Constructor Details

    • HttpInteraction

      public HttpInteraction(Request request, Response response, long duration)
      Constructs a new HTTPInteraction object.
      Parameters:
      request - The HTTP request.
      response - The HTTP response.
      duration - The duration of the request in milliseconds.
  • Method Details

    • getRecordedAt

      public long getRecordedAt()
      Returns the timestamp of when the interaction was recorded.
      Returns:
      The timestamp of when the interaction was recorded.
    • setRecordedAt

      public void setRecordedAt(long recordedAt)
      Set the timestamp of when the interaction was recorded.
      Parameters:
      recordedAt - The timestamp of when the interaction was recorded.
    • getRequest

      public Request getRequest()
      Returns the HTTP request.
      Returns:
      The HTTP request.
    • setRequest

      public void setRequest(Request request)
      Sets the HTTP request.
      Parameters:
      request - The HTTP request.
    • getResponse

      public Response getResponse()
      Returns the HTTP response.
      Returns:
      The HTTP response.
    • setResponse

      public void setResponse(Response response)
      Sets the HTTP response.
      Parameters:
      response - The HTTP response.
    • getDuration

      public long getDuration()
      Returns the duration of the request in milliseconds.
      Returns:
      The duration of the request in milliseconds.
    • setDuration

      public void setDuration(int duration)
      Sets the duration of the request in milliseconds.
      Parameters:
      duration - The duration of the request in milliseconds.