Interface HttpRequestResponse
- All Known Subinterfaces:
OrganizerItem
public interface HttpRequestResponse
This interface is used to define a coupling between
HttpRequest and HttpResponse.-
Method Summary
Modifier and TypeMethodDescriptionbooleanSearches the data in the HTTP request, response and notes for the specified search term.booleanSearches the data in the HTTP request, response and notes for the specified regular expression.Deprecated, for removal: This API element is subject to removal in a future version.Create a copy of theHttpRequestResponsein temporary file.
This method is used to save theHttpRequestResponseobject to a temporary file, so that it is no longer held in memory.booleanstatic HttpRequestResponsehttpRequestResponse(HttpRequest request, HttpResponse response) Create a new instance ofHttpRequestResponse.static HttpRequestResponsehttpRequestResponse(HttpRequest httpRequest, HttpResponse httpResponse, Annotations annotations) Create a new instance ofHttpRequestResponse.HTTP service for the request.request()response()shortDeprecated, for removal: This API element is subject to removal in a future version.useresponse()statusCode instead.Retrieve the timing data associated with this request if available.url()Deprecated, for removal: This API element is subject to removal in a future version.userequest()url instead.withAnnotations(Annotations annotations) Create a copy of theHttpRequestResponsewith the added annotations.withRequestMarkers(Marker... requestMarkers) Create a copy of theHttpRequestResponsewith the added request markers.withRequestMarkers(List<Marker> requestMarkers) Create a copy of theHttpRequestResponsewith the added request markers.withResponseMarkers(Marker... responseMarkers) Create a copy of theHttpRequestResponsewith the added response markers.withResponseMarkers(List<Marker> responseMarkers) Create a copy of theHttpRequestResponsewith the added response markers.
-
Method Details
-
request
HttpRequest request()- Returns:
- The HTTP request message.
-
response
HttpResponse response()- Returns:
- The HTTP response message.
-
httpService
HttpService httpService()HTTP service for the request.- Returns:
- An
HttpServiceobject containing details of the HTTP service.
-
annotations
Annotations annotations()- Returns:
- The annotations.
-
timingData
Optional<TimingData> timingData()Retrieve the timing data associated with this request if available.- Returns:
- The timing data.
-
url
Deprecated, for removal: This API element is subject to removal in a future version.userequest()url instead.Retrieve the URL for the request.
If the request is malformed, then aMalformedRequestExceptionis thrown.- Returns:
- The URL in the request.
- Throws:
MalformedRequestException- if request is malformed.
-
hasResponse
boolean hasResponse()- Returns:
- True if there is an HTTP response message.
-
contentType
Deprecated, for removal: This API element is subject to removal in a future version.userequest()contentType instead.- Returns:
- The detected content type of the request.
-
statusCode
Deprecated, for removal: This API element is subject to removal in a future version.useresponse()statusCode instead.HTTP status code contained in the response.- Returns:
- HTTP status code or -1 if there is no response.
-
requestMarkers
-
responseMarkers
-
contains
Searches the data in the HTTP request, response and notes for the specified search term.- Parameters:
searchTerm- The value to be searched for.caseSensitive- Flags whether the search is case-sensitive.- Returns:
- True if the search term is found.
-
contains
Searches the data in the HTTP request, response and notes for the specified regular expression.- Parameters:
pattern- The regular expression to be searched for.- Returns:
- True if the pattern is matched.
-
copyToTempFile
HttpRequestResponse copyToTempFile()Create a copy of theHttpRequestResponsein temporary file.
This method is used to save theHttpRequestResponseobject to a temporary file, so that it is no longer held in memory. Extensions can use this method to convertHttpRequestobjects into a form suitable for long-term usage.- Returns:
- A new
ByteArrayinstance stored in temporary file.
-
withAnnotations
Create a copy of theHttpRequestResponsewith the added annotations.- Parameters:
annotations- annotations to add.- Returns:
- A new
HttpRequestResponseinstance.
-
withRequestMarkers
Create a copy of theHttpRequestResponsewith the added request markers.- Parameters:
requestMarkers- Request markers to add.- Returns:
- A new
HttpRequestResponseinstance.
-
withRequestMarkers
Create a copy of theHttpRequestResponsewith the added request markers.- Parameters:
requestMarkers- Request markers to add.- Returns:
- A new
HttpRequestResponseinstance.
-
withResponseMarkers
Create a copy of theHttpRequestResponsewith the added response markers.- Parameters:
responseMarkers- Response markers to add.- Returns:
- A new
HttpRequestResponseinstance.
-
withResponseMarkers
Create a copy of theHttpRequestResponsewith the added response markers.- Parameters:
responseMarkers- Response markers to add.- Returns:
- A new
HttpRequestResponseinstance.
-
httpRequestResponse
Create a new instance ofHttpRequestResponse.- Parameters:
request- The HTTP request.response- The HTTP response.- Returns:
- A new
HttpRequestResponseinstance.
-
httpRequestResponse
static HttpRequestResponse httpRequestResponse(HttpRequest httpRequest, HttpResponse httpResponse, Annotations annotations) Create a new instance ofHttpRequestResponse.- Parameters:
httpRequest- The HTTP request.httpResponse- The HTTP response.annotations- annotations.- Returns:
- A new
HttpRequestResponseinstance.
-
request()contentType instead.