Uses of Class
org.mockserver.model.HttpResponse
Packages that use HttpResponse
Package
Description
-
Uses of HttpResponse in org.mockserver.client
Methods in org.mockserver.client that return HttpResponseModifier and TypeMethodDescriptionBreakpointResponseHandler.handle(HttpRequest httpRequest, HttpResponse httpResponse) Handle a paused response at the RESPONSE breakpoint phase.MockServerClient.replay(HttpRequest requestToReplay) Replay a request to its upstream target and return the upstream response.Methods in org.mockserver.client with parameters of type HttpResponseModifier and TypeMethodDescriptionBreakpointResponseHandler.handle(HttpRequest httpRequest, HttpResponse httpResponse) Handle a paused response at the RESPONSE breakpoint phase.ForwardChainExpectation.respond(HttpResponse httpResponse) Return response when expectation is matchedMockServerClient.verify(HttpResponse httpResponse) Verify a response has been recorded (matching any request), defaulting to at least onceMockServerClient.verify(HttpResponse httpResponse, VerificationTimes times) Verify a response has been recorded (matching any request) for example:MockServerClient.verify(RequestDefinition requestDefinition, HttpResponse httpResponse, VerificationTimes times) Verify a request-response pair has been recorded for example:Method parameters in org.mockserver.client with type arguments of type HttpResponseModifier and TypeMethodDescriptionForwardChainExpectation.respond(List<HttpResponse> httpResponses) Set a list of responses to cycle through sequentially when expectation is matched.ForwardChainExpectation.withHttpResponses(List<HttpResponse> httpResponses) Set a list of responses for stateful / multi-response selection. -
Uses of HttpResponse in org.mockserver.closurecallback.websocketregistry
Methods in org.mockserver.closurecallback.websocketregistry with parameters of type HttpResponseModifier and TypeMethodDescriptionvoidWebSocketResponseCallback.handle(HttpResponse httpResponse) voidWebSocketRequestCallback.handleError(HttpResponse httpResponse) booleanWebSocketClientRegistry.sendClientMessage(String clientId, HttpRequest httpRequest, HttpResponse httpResponse) -
Uses of HttpResponse in org.mockserver.codec
Methods in org.mockserver.codec with parameters of type HttpResponseModifier and TypeMethodDescriptionprotected voidMockServerHttpToNettyHttpResponseEncoder.encode(io.netty.channel.ChannelHandlerContext ctx, HttpResponse response, List<Object> out) -
Uses of HttpResponse in org.mockserver.cors
Methods in org.mockserver.cors with parameters of type HttpResponseModifier and TypeMethodDescriptionvoidCORSHeaders.addCORSHeaders(HttpRequest request, HttpResponse response) -
Uses of HttpResponse in org.mockserver.dashboard.model
Methods in org.mockserver.dashboard.model that return HttpResponseMethods in org.mockserver.dashboard.model with parameters of type HttpResponseModifier and TypeMethodDescriptionDashboardLogEntryDTO.setHttpResponse(HttpResponse httpResponse) -
Uses of HttpResponse in org.mockserver.echo.http
Fields in org.mockserver.echo.http with type parameters of type HttpResponseMethods in org.mockserver.echo.http with parameters of type HttpResponseModifier and TypeMethodDescriptionvoidEchoServer.withNextResponse(HttpResponse... httpResponses) -
Uses of HttpResponse in org.mockserver.examples.mockserver
Methods in org.mockserver.examples.mockserver that return HttpResponseModifier and TypeMethodDescriptionCallbackActionExamples.TestExpectationResponseCallback.handle(HttpRequest httpRequest) -
Uses of HttpResponse in org.mockserver.filters
Methods in org.mockserver.filters that return HttpResponseMethods in org.mockserver.filters with parameters of type HttpResponse -
Uses of HttpResponse in org.mockserver.fixture
Methods in org.mockserver.fixture that return HttpResponseModifier and TypeMethodDescriptionFixtureRedactor.redactResponseObject(HttpResponse response) Redact sensitive headers (and configured JSON body fields) in a single response, returning a redacted clone.Methods in org.mockserver.fixture with parameters of type HttpResponseModifier and TypeMethodDescriptionFixtureRedactor.redactResponseObject(HttpResponse response) Redact sensitive headers (and configured JSON body fields) in a single response, returning a redacted clone. -
Uses of HttpResponse in org.mockserver.grpc.connect
Methods in org.mockserver.grpc.connect that return HttpResponseModifier and TypeMethodDescriptionstatic HttpResponseConnectResponse.error(ConnectError error) A Connect unary error response: a non-200 HTTP status mapped from the Connect error code, with a JSON body of the shape{"code","message","details"}andContent-Type: application/json.static HttpResponseConnectResponse.error(ConnectError.Code code, String message) Shorthand forConnectResponse.error(ConnectError)from aConnectError.Codeand message.static HttpResponseA successful Connect unary response: HTTP 200,Content-Type: application/json, body is the response message JSON directly (no envelope, no framing).static HttpResponseA successful Connect unary response with an explicit content type, e.g. -
Uses of HttpResponse in org.mockserver.httpclient
Methods in org.mockserver.httpclient that return HttpResponseModifier and TypeMethodDescriptionNettyHttpClient.sendRequest(HttpRequest httpRequest, long timeout, TimeUnit unit) NettyHttpClient.sendRequest(HttpRequest httpRequest, long timeout, TimeUnit unit, boolean ignoreErrors) Methods in org.mockserver.httpclient that return types with arguments of type HttpResponseModifier and TypeMethodDescriptionNettyHttpClient.sendRequest(HttpRequest httpRequest) NettyHttpClient.sendRequest(HttpRequest httpRequest, InetSocketAddress remoteAddress) NettyHttpClient.sendRequest(HttpRequest httpRequest, InetSocketAddress remoteAddress, Long connectionTimeoutMillis) NettyHttpClient.sendRequest(HttpRequest httpRequest, InetSocketAddress remoteAddress, Long connectionTimeoutMillis, boolean disableStreaming) -
Uses of HttpResponse in org.mockserver.llm
Methods in org.mockserver.llm that return HttpResponseModifier and TypeMethodDescriptiondefault HttpResponseProviderCodec.encode(Completion completion, String model) default HttpResponseProviderCodec.encodeEmbedding(EmbeddingResponse embedding, String input) default HttpResponseProviderCodec.encodeEmbedding(EmbeddingResponse embedding, String input, String model) Model-aware embedding encode.default HttpResponseProviderCodec.encodeRerank(RerankResponse rerank, List<String> documents) Encode a rerank response for providers that expose a rerank endpoint (e.g. -
Uses of HttpResponse in org.mockserver.llm.analysis
Methods in org.mockserver.llm.analysis that return HttpResponseConstructors in org.mockserver.llm.analysis with parameters of type HttpResponseModifierConstructorDescriptionCapturedExchange(HttpRequest request, HttpResponse response, Long latencyMs) -
Uses of HttpResponse in org.mockserver.llm.client
Methods in org.mockserver.llm.client that return HttpResponseModifier and TypeMethodDescriptionLlmTransport.send(HttpRequest request, long timeoutMillis) Send the request and return the response, or throw on transport failure.NettyHttpClientLlmTransport.send(HttpRequest request, long timeoutMillis) Methods in org.mockserver.llm.client with parameters of type HttpResponseModifier and TypeMethodDescriptionstatic StringLlmProviderSniffer.extractModelFromResponse(HttpResponse response) Extract the model name from the forwarded response body.AnthropicLlmClient.parseCompletionResponse(HttpResponse response) GeminiLlmClient.parseCompletionResponse(HttpResponse response) LlmClient.parseCompletionResponse(HttpResponse response) Parse a successful provider response body into aCompletion.OllamaLlmClient.parseCompletionResponse(HttpResponse response) OpenAiLlmClient.parseCompletionResponse(HttpResponse response) OpenAiResponsesLlmClient.parseCompletionResponse(HttpResponse response) protected com.fasterxml.jackson.databind.JsonNodeAbstractLlmClient.readBody(HttpResponse response) Parse a response body into a JSON tree. -
Uses of HttpResponse in org.mockserver.llm.codec
Methods in org.mockserver.llm.codec that return HttpResponseModifier and TypeMethodDescriptionAnthropicCodec.encode(Completion completion, String model) AzureOpenAiCodec.encode(Completion completion, String model) BedrockCodec.encode(Completion completion, String model) GeminiCodec.encode(Completion completion, String model) OllamaCodec.encode(Completion completion, String model) OpenAiChatCompletionsCodec.encode(Completion completion, String model) OpenAiResponsesCodec.encode(Completion completion, String model) static HttpResponseRerankScoring.encode(RerankResponse rerank, List<String> documents, String model, RerankScoring.Envelope envelope) Build the provider-correct rerank HTTP response from the scored documents, using the provider's envelope shape.AnthropicCodec.encodeEmbedding(EmbeddingResponse embedding, String input) AzureOpenAiCodec.encodeEmbedding(EmbeddingResponse embedding, String input) BedrockCodec.encodeEmbedding(EmbeddingResponse embedding, String input) Bedrock embeddings without a model hint default to the Amazon Titan shape.BedrockCodec.encodeEmbedding(EmbeddingResponse embedding, String input, String model) Encodes a BedrockInvokeModelembedding response.GeminiCodec.encodeEmbedding(EmbeddingResponse embedding, String input) Encodes a GeminiembedContentresponse (POST /v1beta/models/{model}:embedContent).OllamaCodec.encodeEmbedding(EmbeddingResponse embedding, String input) Encodes an Ollama embedding response.OllamaCodec.encodeEmbedding(EmbeddingResponse embedding, String input, String model) OpenAiChatCompletionsCodec.encodeEmbedding(EmbeddingResponse embedding, String input) OpenAiResponsesCodec.encodeEmbedding(EmbeddingResponse embedding, String input) CohereCodec.encodeRerank(RerankResponse rerank, List<String> documents) VoyageCodec.encodeRerank(RerankResponse rerank, List<String> documents) -
Uses of HttpResponse in org.mockserver.log.model
Methods in org.mockserver.log.model that return HttpResponseModifier and TypeMethodDescriptionLogEntry.getHttpResponse()LogEntry.getHttpUpdatedResponse()LogEntry.getRedactedHttpResponse()LikeLogEntry.getHttpResponse()but with sensitive data masked whenmockserver.redactSecretsInLogis enabled; returns the raw response unchanged when redaction is off.Methods in org.mockserver.log.model with parameters of type HttpResponseModifier and TypeMethodDescriptionLogEntry.setExpectation(RequestDefinition httpRequest, HttpResponse httpResponse) LogEntry.setHttpResponse(HttpResponse httpResponse) -
Uses of HttpResponse in org.mockserver.mappers
Methods in org.mockserver.mappers that return HttpResponseModifier and TypeMethodDescriptionFullHttpResponseToMockServerHttpResponse.mapFullHttpResponseToMockServerResponse(io.netty.handler.codec.http.FullHttpResponse fullHttpResponse) Methods in org.mockserver.mappers with parameters of type HttpResponseModifier and TypeMethodDescriptionvoidMockServerHttpResponseToHttpServletResponseEncoder.mapMockServerResponseToHttpServletResponse(HttpResponse httpResponse, jakarta.servlet.http.HttpServletResponse httpServletResponse) List<io.netty.handler.codec.http.DefaultHttpObject>MockServerHttpResponseToFullHttpResponse.mapMockServerResponseToNettyResponse(HttpResponse httpResponse) -
Uses of HttpResponse in org.mockserver.matchers
Methods in org.mockserver.matchers with parameters of type HttpResponseModifier and TypeMethodDescriptionbooleanHttpResponseMatcher.matches(MatchDifference context, HttpResponse actual) Returnstruewhen the actual response matches the template, recording per-field differences intocontextwhen it is non-null.booleanHttpResponseMatcher.matches(HttpResponse actual) Returnstruewhen the actual response matches the template.static BodySourceBodyMatching.of(HttpResponse response) Adapts anHttpResponseto theBodySourceabstraction.Constructors in org.mockserver.matchers with parameters of type HttpResponseModifierConstructorDescriptionHttpResponseMatcher(Configuration configuration, MockServerLogger mockServerLogger, HttpResponse template) -
Uses of HttpResponse in org.mockserver.mock
Methods in org.mockserver.mock that return HttpResponseModifier and TypeMethodDescriptionHttpState.debugMismatch(HttpRequest request) HttpState.explainUnmatched(HttpRequest request) Retrieves recent requests that matched no expectation and, for each, computes ranked closest-expectation diagnostics with remediation hints.Expectation.getHttpResponse()HttpState.retrieve(HttpRequest request) Methods in org.mockserver.mock that return types with arguments of type HttpResponseMethods in org.mockserver.mock with parameters of type HttpResponseMethod parameters in org.mockserver.mock with type arguments of type HttpResponseModifier and TypeMethodDescriptionvoidHttpState.setReplayHandler(Function<HttpRequest, CompletableFuture<HttpResponse>> replayHandler) Install the replay handler that re-issues anHttpRequestto its target and returns the upstream response.Expectation.thenRespond(List<HttpResponse> httpResponses) -
Uses of HttpResponse in org.mockserver.mock.action
Methods in org.mockserver.mock.action that return HttpResponseModifier and TypeMethodDescriptionExpectationForwardAndResponseCallback.handle(HttpRequest httpRequest, HttpResponse httpResponse) Called for every response received from a proxied request, the return value is the returned by MockServer.ExpectationResponseCallback.handle(HttpRequest httpRequest) Called for every request when expectation condition has been satisfied.Methods in org.mockserver.mock.action with parameters of type HttpResponseModifier and TypeMethodDescriptionExpectationForwardAndResponseCallback.handle(HttpRequest httpRequest, HttpResponse httpResponse) Called for every response received from a proxied request, the return value is the returned by MockServer. -
Uses of HttpResponse in org.mockserver.mock.action.http
Methods in org.mockserver.mock.action.http that return HttpResponseModifier and TypeMethodDescriptionHttpLlmResponseActionHandler.chaosErrorResponseOrNull(HttpLlmResponse httpLlmResponse) Returns an errorHttpResponse(status + optionalRetry-After) when the chaos profile triggers a probabilistic error, ornullotherwise.LlmCostBudgetMonitor.checkBudgetOrNull()Check the budget and return an error response if exceeded, ornullif the request should proceed.HttpLlmResponseActionHandler.enforcementErrorResponseOrNull(HttpLlmResponse httpLlmResponse, HttpRequest request) Strict structured-output enforcement, opt-in viaCompletion.getEnforceOutputSchema().HttpLlmResponseActionHandler.handle(HttpLlmResponse httpLlmResponse, HttpRequest request) HttpResponseActionHandler.handle(HttpResponse httpResponse) HttpResponseActionHandler.handle(HttpResponse httpResponse, HttpRequest httpRequest) HttpResponseActionHandler.handle(HttpResponse httpResponse, HttpRequest httpRequest, RequestDefinition matchedRequest) Materialises the response for a matched expectation against the incoming request.HttpResponseClassCallbackActionHandler.handle(HttpClassCallback httpClassCallback, HttpRequest request) HttpResponseTemplateActionHandler.handle(HttpTemplate httpTemplate, HttpRequest httpRequest) Methods in org.mockserver.mock.action.http that return types with arguments of type HttpResponseModifier and TypeMethodDescriptionstatic CompletableFuture<HttpResponse>ForwardRetryPolicy.execute(String method, int maxRetries, long backoffMillis, Supplier<CompletableFuture<HttpResponse>> attempt) Runattemptwith retry.HttpForwardActionResult.getHttpResponse()Methods in org.mockserver.mock.action.http with parameters of type HttpResponseModifier and TypeMethodDescriptionHttpResponseActionHandler.handle(HttpResponse httpResponse) HttpResponseActionHandler.handle(HttpResponse httpResponse, HttpRequest httpRequest) HttpResponseActionHandler.handle(HttpResponse httpResponse, HttpRequest httpRequest, RequestDefinition matchedRequest) Materialises the response for a matched expectation against the incoming request.static booleanForwardRetryPolicy.isTransientFailure(HttpResponse response, Throwable throwable) Whether a completed attempt (response or throwable) should be retried.Method parameters in org.mockserver.mock.action.http with type arguments of type HttpResponseModifier and TypeMethodDescriptionstatic CompletableFuture<HttpResponse>ForwardRetryPolicy.execute(String method, int maxRetries, long backoffMillis, Supplier<CompletableFuture<HttpResponse>> attempt) Runattemptwith retry.protected HttpForwardActionResultHttpForwardAction.sendRequest(HttpRequest request, InetSocketAddress remoteAddress, Function<HttpResponse, HttpResponse> overrideHttpResponse) protected HttpForwardActionResultHttpForwardAction.sendRequest(HttpRequest request, InetSocketAddress remoteAddress, Function<HttpResponse, HttpResponse> overrideHttpResponse) protected HttpForwardActionResultHttpForwardAction.sendRequest(HttpRequest request, InetSocketAddress remoteAddress, Function<HttpResponse, HttpResponse> overrideHttpResponse, boolean disableStreaming) protected HttpForwardActionResultHttpForwardAction.sendRequest(HttpRequest request, InetSocketAddress remoteAddress, Function<HttpResponse, HttpResponse> overrideHttpResponse, boolean disableStreaming) HttpForwardActionResult.setHttpResponse(CompletableFuture<HttpResponse> httpResponse) voidLoadScenarioOrchestrator.setSender(Function<HttpRequest, CompletableFuture<HttpResponse>> sender) Install the request sender that re-issues aHttpRequestto its target and returns the upstream response.LoadScenarioOrchestrator.start(LoadScenario scenario, Function<HttpRequest, CompletableFuture<HttpResponse>> sender) Trigger a scenario to start (run it).Constructor parameters in org.mockserver.mock.action.http with type arguments of type HttpResponseModifierConstructorDescriptionHttpForwardActionResult(HttpRequest httpRequest, CompletableFuture<HttpResponse> httpResponse, Function<HttpResponse, HttpResponse> overrideHttpResponse) HttpForwardActionResult(HttpRequest httpRequest, CompletableFuture<HttpResponse> httpResponse, Function<HttpResponse, HttpResponse> overrideHttpResponse) HttpForwardActionResult(HttpRequest httpRequest, CompletableFuture<HttpResponse> httpResponse, Function<HttpResponse, HttpResponse> overrideHttpResponse) -
Uses of HttpResponse in org.mockserver.mock.breakpoint
Methods in org.mockserver.mock.breakpoint that return HttpResponseModifier and TypeMethodDescriptionBreakpointDecision.getAbortResponse()BreakpointDecision.getModifiedResponse()The modified response (non-null only for RESPONSE-phase MODIFY decisions).Methods in org.mockserver.mock.breakpoint with parameters of type HttpResponseModifier and TypeMethodDescriptionstatic BreakpointDecisionBreakpointDecision.abort(HttpResponse abortResponse) BreakpointCallbackDispatcher.dispatchResponse(String clientId, String breakpointId, HttpRequest request, HttpResponse response, WebSocketClientRegistry webSocketClientRegistry, Configuration configuration, MockServerLogger logger) Dispatches a RESPONSE-phase breakpoint over the callback WebSocket, tagging the message with the matched breakpoint id.BreakpointCallbackDispatcher.dispatchResponse(String clientId, HttpRequest request, HttpResponse response, WebSocketClientRegistry webSocketClientRegistry, Configuration configuration, MockServerLogger logger) Dispatches a RESPONSE-phase breakpoint over the callback WebSocket.BreakpointMatcherRegistry.findResponseMatch(RequestDefinition request, HttpResponse response, BreakpointPhase phase) Response-phase variant ofBreakpointMatcherRegistry.findMatch(org.mockserver.model.RequestDefinition, org.mockserver.mock.breakpoint.BreakpointPhase)that additionally evaluates each matcher's optional response-content conditions (status-code range / body regex) against the actualresponseabout to be written.static BreakpointDecisionBreakpointDecision.modifyResponse(HttpResponse modifiedResponse) Modify a RESPONSE-phase exchange: write a replacement response to the client.booleanBreakpointMatcher.responseConditionMatches(HttpResponse response) Evaluates the optional response-content conditions against the given response. -
Uses of HttpResponse in org.mockserver.mock.crud
Methods in org.mockserver.mock.crud that return HttpResponseModifier and TypeMethodDescriptionCrudDispatcher.dispatch(HttpRequest request) CrudActionHandler.handleCreate(HttpRequest request) CrudActionHandler.handleDelete(HttpRequest request) CrudActionHandler.handleGetById(HttpRequest request) CrudActionHandler.handleList(HttpRequest request) CrudActionHandler.handlePatch(HttpRequest request) CrudActionHandler.handleUpdate(HttpRequest request) -
Uses of HttpResponse in org.mockserver.mock.diff
Methods in org.mockserver.mock.diff that return HttpResponseConstructors in org.mockserver.mock.diff with parameters of type HttpResponse -
Uses of HttpResponse in org.mockserver.mock.drift
Methods in org.mockserver.mock.drift with parameters of type HttpResponseModifier and TypeMethodDescriptionvoidDriftAnalyzer.analyse(Expectation expectation, HttpResponse realResponse) Analyse the real forwarded response against the expectation's stub response.voidSemanticDriftExtension.enrich(List<DriftRecord> records, String expectationId, HttpResponse stubResponse, HttpResponse realResponse) Enriches drift records with semantic severity and explanation using the LLM.Method parameters in org.mockserver.mock.drift with type arguments of type HttpResponseModifier and TypeMethodDescriptionvoidDriftAlertNotifier.setSender(Function<HttpRequest, CompletableFuture<HttpResponse>> sender) Install the request sender that issues an outboundHttpRequestand returns the response. -
Uses of HttpResponse in org.mockserver.model
Methods in org.mockserver.model that return HttpResponseModifier and TypeMethodDescriptionstatic HttpResponseHttpResponse.badGatewayResponse()Static builder to create a bad gateway response.HttpResponse.clone()RecoverAfter.getFailResponse()HttpForwardWithFallback.getFallbackResponse()ExpectationStep.getHttpResponse()HttpRequestAndHttpResponse.getHttpResponse()LogEventRequestAndResponse.getHttpResponse()HttpOverrideForwardedRequest.getResponseOverride()HttpTemplate.getResponseOverride()static HttpResponseHttpResponse.notFoundResponse()Static builder to create a not found response.HttpResponse.removeHeader(String name) HttpResponse.removeHeader(NottableString name) HttpResponse.replaceHeader(String name, String... values) Update header to return as a Header object, if a header with the same name already exists it will be modifiedHttpResponse.replaceHeader(Header header) Update header to return as a Header object, if a header with the same name already exists it will be modifiedstatic HttpResponseHttpResponse.response()Static builder to create a response.static HttpResponseStatic builder to create a response with a 200 status code and the string response body.HttpResponse.shallowClone()HttpResponse.update(HttpResponse responseOverride, HttpResponseModifier responseModifier) HttpResponse.update(HttpResponse responseOverride, HttpResponseModifier responseModifier, HttpRequest request) HttpResponse.withBody(byte[] body) Set response body to return as binary such as a pdf or imageSet response body to return as a string response body.Set response body to return a string response body with the specified encoding.Set response body to return a string response body with the specified encoding.HttpResponse.withBody(BodyWithContentType body) Set the body to return for example:HttpResponse.withBodyFromFile(String filePath) HttpResponse.withBodyFromFile(String filePath, MediaType contentType) HttpResponse.withConnectionOptions(ConnectionOptions connectionOptions) The connection options for override the default connection behaviour, this allows full control of headers such as "Connection" or "Content-Length" or controlling whether the socket is closed after the response has been sentHttpResponse.withContentType(MediaType mediaType) HttpResponse.withCookie(String name, String value) Add cookie to return as Set-Cookie headerHttpResponse.withCookie(Cookie cookie) Add cookie to return as Set-Cookie headerHttpResponse.withCookie(NottableString name, NottableString value) Adds one cookie to match on or to not match on using the NottableString, each NottableString can either be a positive matching value, such as string("match"), or a value to not match on, such as not("do not match"), the string values passed to the NottableString can be a plain string or a regex (for more details of the supported regex syntax see ...)HttpResponse.withCookies(List<Cookie> cookies) The cookies to return as Set-Cookie headers as a list of Cookie objectsHttpResponse.withCookies(Cookie... cookies) The cookies to return as Set-Cookie headers as a varargs of Cookie objectsHttpResponse.withCookies(Cookies cookies) HttpResponse.withGenerateFromSchema(String generateFromSchema) Provide an inline JSON Schema (a plain JSON Schema object, not a full OpenAPI document) from which a schema-valid response body is generated at response time.HttpResponse.withHeader(String name, String... values) Add a header to return as a Header object, if a header with the same name already exists this will NOT be modified but two headers will existHttpResponse.withHeader(Header header) Add a header to return as a Header object, if a header with the same name already exists this will NOT be modified but two headers will existHttpResponse.withHeader(NottableString name, NottableString... values) Add a header to return as a Header object, if a header with the same name already exists this will NOT be modified but two headers will existHttpResponse.withHeaders(List<Header> headers) The headers to return as a list of Header objectsHttpResponse.withHeaders(Header... headers) The headers to return as a varargs of Header objectsHttpResponse.withHeaders(Headers headers) HttpResponse.withReasonPhrase(String reasonPhrase) The reason phrase to return, if no reason code is returned this will be defaulted to the standard reason phrase for the statusCode, i.e. for a statusCode of 200 the standard reason phrase is "OK"HttpResponse.withRecoverAfter(RecoverAfter recoverAfter) Attach a retry/backoff recovery primitive: serve a failure response for the firstfailTimesmatches, then serve this configured response.HttpResponse.withStatusCode(Integer statusCode) The status code to return, such as 200, 404, the status code specified here will result in the default status message for this status code for example for 200 the status message "OK" is usedHttpResponse.withStatusCodeRange(String statusCodeRange) A status-code range or numeric-operator expression used only when verifying a recorded response (it is never written to the wire when serving).HttpResponse.withStreamId(Integer streamId) HttpResponse.withStreamingBody(StreamingBody streamingBody) Attach a streaming body to this response.HttpResponse.withTiming(Timing timing) HttpResponse.withTrailer(String name, String... values) Add a trailing header to send, if a trailer with the same name already exists this will NOT be modified but two trailers will existHttpResponse.withTrailer(Header trailer) Add a trailing header to send as a Header object, if a trailer with the same name already exists this will NOT be modified but two trailers will existHttpResponse.withTrailer(NottableString name, NottableString... values) Add a trailing header to send, if a trailer with the same name already exists this will NOT be modified but two trailers will existHttpResponse.withTrailers(List<Header> trailers) The trailing headers to send as a list of Header objectsHttpResponse.withTrailers(Header... trailers) The trailing headers to send as a varargs of Header objectsHttpResponse.withTrailers(Headers trailers) The trailing headers (HTTP trailers) to send after the response body.Methods in org.mockserver.model with parameters of type HttpResponseModifier and TypeMethodDescriptionvoidHttpResponseModifier.applyTo(HttpResponse response, HttpRequest request) Apply this modifier toresponse, honouring any condition and chain.static HttpOverrideForwardedRequestHttpOverrideForwardedRequest.forwardOverriddenRequest(HttpRequest httpRequest, HttpRequestModifier requestModifier, HttpResponse httpResponse, HttpResponseModifier responseModifier) Static builder which will allow overriding proxied request with the specified request.static HttpOverrideForwardedRequestHttpOverrideForwardedRequest.forwardOverriddenRequest(HttpRequest httpRequest, HttpResponse httpResponse) Static builder which will allow overriding proxied request with the specified request.booleanHttpResponseModifierCondition.matches(HttpResponse response, HttpRequest request) HttpResponse.update(HttpResponse responseOverride, HttpResponseModifier responseModifier) HttpResponse.update(HttpResponse responseOverride, HttpResponseModifier responseModifier, HttpRequest request) RecoverAfter.withFailResponse(HttpResponse failResponse) HttpForwardWithFallback.withFallback(HttpResponse fallbackResponse) The mock response to return when the upstream forward fails or returns a status code that matches the fallback criteria.ExpectationStep.withHttpResponse(HttpResponse httpResponse) HttpRequestAndHttpResponse.withHttpResponse(HttpResponse httpResponse) LogEventRequestAndResponse.withHttpResponse(HttpResponse httpResponse) HttpOverrideForwardedRequest.withResponseOverride(HttpResponse httpResponse) All fields, headers, cookies, etc of the provided response will be overriddenHttpTemplate.withResponseOverride(HttpResponse responseOverride) -
Uses of HttpResponse in org.mockserver.netty.grpc
Methods in org.mockserver.netty.grpc with parameters of type HttpResponseModifier and TypeMethodDescriptionprotected voidGrpcToHttpResponseHandler.encode(io.netty.channel.ChannelHandlerContext ctx, HttpResponse response, List<Object> out) -
Uses of HttpResponse in org.mockserver.netty.http3
Methods in org.mockserver.netty.http3 with parameters of type HttpResponseModifier and TypeMethodDescriptionvoidHttp3GrpcResponseWriter.sendResponse(HttpRequest request, HttpResponse response) voidHttp3ResponseWriter.sendResponse(HttpRequest request, HttpResponse response) static io.netty.handler.codec.http3.DefaultHttp3DataFrameHttp3RequestBridge.toHttp3DataFrame(HttpResponse response) Convert the body of a MockServerHttpResponseinto an HTTP/3 data frame.static io.netty.handler.codec.http3.DefaultHttp3HeadersFrameHttp3RequestBridge.toHttp3HeadersFrame(HttpResponse response) Convert a MockServerHttpResponseinto an HTTP/3 headers frame.static io.netty.handler.codec.http3.DefaultHttp3HeadersFrameHttp3RequestBridge.toHttp3TrailersFrame(HttpResponse response) Build a trailing HTTP/3 HEADERS frame from the response trailers, or null when the response carries no trailers.GrpcHttp3Adapter.transformGrpcResponse(HttpResponse response, String serviceName, String methodName, GrpcProtoDescriptorStore descriptorStore) Convert the response from the matching pipeline back to a gRPC-framed response. -
Uses of HttpResponse in org.mockserver.netty.responsewriter
Methods in org.mockserver.netty.responsewriter with parameters of type HttpResponseModifier and TypeMethodDescriptionvoidEarlyNettyResponseWriter.sendResponse(HttpRequest request, HttpResponse response) voidNettyResponseWriter.sendResponse(HttpRequest request, HttpResponse response) -
Uses of HttpResponse in org.mockserver.oidc
Methods in org.mockserver.oidc that return HttpResponseModifier and TypeMethodDescriptionOidcAuthorizationCodeCallback.handle(HttpRequest request) OidcDeviceAuthorizationCallback.handle(HttpRequest request) OidcIntrospectionCallback.handle(HttpRequest request) OidcLogoutCallback.handle(HttpRequest request) OidcTokenCallback.handle(HttpRequest request) -
Uses of HttpResponse in org.mockserver.openapi
Methods in org.mockserver.openapi with parameters of type HttpResponseModifier and TypeMethodDescriptionOpenAPIResponseValidator.validate(String specUrlOrPayload, String operationId, HttpResponse response, MockServerLogger logger) Method parameters in org.mockserver.openapi with type arguments of type HttpResponseModifier and TypeMethodDescriptionOpenApiContractTest.runContractTests(String specUrlOrPayload, String baseUrl, String operationIdFilter, Function<HttpRequest, HttpResponse> httpSender) Runs contract tests for each operation in the spec.OpenApiResiliencyTest.runResiliencyTests(String specUrlOrPayload, String baseUrl, String operationIdFilter, Function<HttpRequest, HttpResponse> httpSender) Runs resiliency tests for each operation in the spec.OpenApiTrafficValidator.validate(String specUrlOrPayload, List<org.apache.commons.lang3.tuple.Pair<HttpRequest, HttpResponse>> requestResponsePairs) Validates a list of request/response pairs against the given OpenAPI spec. -
Uses of HttpResponse in org.mockserver.responseheaders
Methods in org.mockserver.responseheaders with parameters of type HttpResponseModifier and TypeMethodDescriptionvoidDefaultResponseHeaders.addDefaultResponseHeaders(HttpResponse response) Adds each configured default header to the response only if the response does not already contain a header with that name (case-insensitive). -
Uses of HttpResponse in org.mockserver.responsewriter
Methods in org.mockserver.responsewriter that return HttpResponseModifier and TypeMethodDescriptionprotected HttpResponseResponseWriter.addConnectionHeader(HttpRequest request, HttpResponse response) Methods in org.mockserver.responsewriter with parameters of type HttpResponseModifier and TypeMethodDescriptionprotected HttpResponseResponseWriter.addConnectionHeader(HttpRequest request, HttpResponse response) abstract voidResponseWriter.sendResponse(HttpRequest request, HttpResponse response) voidResponseWriter.writeResponse(HttpRequest request, HttpResponse response, boolean apiResponse) -
Uses of HttpResponse in org.mockserver.saml
Methods in org.mockserver.saml that return HttpResponseModifier and TypeMethodDescriptionSamlSloCallback.handle(HttpRequest request) SamlSsoCallback.handle(HttpRequest request) -
Uses of HttpResponse in org.mockserver.scheduler
Method parameters in org.mockserver.scheduler with type arguments of type HttpResponseModifier and TypeMethodDescriptionvoidScheduler.submit(HttpForwardActionResult future, BiConsumer<HttpResponse, Throwable> consumer, boolean synchronous) -
Uses of HttpResponse in org.mockserver.scim
Methods in org.mockserver.scim that return HttpResponseModifier and TypeMethodDescriptionScimCollectionCallback.handle(HttpRequest request) ScimResourceCallback.handle(HttpRequest request) -
Uses of HttpResponse in org.mockserver.serialization
Methods in org.mockserver.serialization that return HttpResponseModifier and TypeMethodDescriptionHttpResponseSerializer.deserialize(String jsonHttpResponse) HttpResponseSerializer.deserializeArray(String jsonHttpResponses) Methods in org.mockserver.serialization that return types with arguments of type HttpResponseMethods in org.mockserver.serialization with parameters of type HttpResponseModifier and TypeMethodDescriptionHttpResponseSerializer.serialize(HttpResponse httpResponse) HttpResponseSerializer.serialize(HttpResponse... httpResponses) Method parameters in org.mockserver.serialization with type arguments of type HttpResponseModifier and TypeMethodDescriptionHttpResponseSerializer.serialize(List<HttpResponse> httpResponses) -
Uses of HttpResponse in org.mockserver.serialization.java
Methods in org.mockserver.serialization.java with parameters of type HttpResponseModifier and TypeMethodDescriptionHttpResponseToJavaSerializer.serialize(int numberOfSpacesToIndent, HttpResponse httpResponse) -
Uses of HttpResponse in org.mockserver.serialization.model
Methods in org.mockserver.serialization.model that return HttpResponseConstructors in org.mockserver.serialization.model with parameters of type HttpResponse -
Uses of HttpResponse in org.mockserver.serialization.serializers.response
Methods in org.mockserver.serialization.serializers.response with parameters of type HttpResponseModifier and TypeMethodDescriptionvoidHttpResponseSerializer.serialize(HttpResponse httpResponse, com.fasterxml.jackson.core.JsonGenerator jgen, com.fasterxml.jackson.databind.SerializerProvider provider) -
Uses of HttpResponse in org.mockserver.servlet.responsewriter
Methods in org.mockserver.servlet.responsewriter with parameters of type HttpResponseModifier and TypeMethodDescriptionvoidServletResponseWriter.sendResponse(HttpRequest request, HttpResponse response) -
Uses of HttpResponse in org.mockserver.templates
Methods in org.mockserver.templates that return HttpResponseModifier and TypeMethodDescriptionstatic HttpResponseResponseTemplateTester.testJavaScriptTemplate(String template, HttpRequest request) static HttpResponseResponseTemplateTester.testMustacheTemplate(String template, HttpRequest request) static HttpResponseResponseTemplateTester.testVelocityTemplate(String template, HttpRequest request) -
Uses of HttpResponse in org.mockserver.templates.engine
Methods in org.mockserver.templates.engine with parameters of type HttpResponseModifier and TypeMethodDescription<T> TTemplateEngine.executeTemplate(String template, HttpRequest httpRequest, HttpResponse httpResponse, Class<? extends DTO<T>> dtoClass) -
Uses of HttpResponse in org.mockserver.templates.engine.javascript
Methods in org.mockserver.templates.engine.javascript with parameters of type HttpResponseModifier and TypeMethodDescription<T> TJavaScriptTemplateEngine.executeTemplate(String template, HttpRequest request, HttpResponse response, Class<? extends DTO<T>> dtoClass) -
Uses of HttpResponse in org.mockserver.templates.engine.model
Constructors in org.mockserver.templates.engine.model with parameters of type HttpResponse -
Uses of HttpResponse in org.mockserver.templates.engine.mustache
Methods in org.mockserver.templates.engine.mustache with parameters of type HttpResponseModifier and TypeMethodDescription<T> TMustacheTemplateEngine.executeTemplate(String template, HttpRequest request, HttpResponse response, Class<? extends DTO<T>> dtoClass) -
Uses of HttpResponse in org.mockserver.templates.engine.velocity
Methods in org.mockserver.templates.engine.velocity with parameters of type HttpResponseModifier and TypeMethodDescription<T> TVelocityTemplateEngine.executeTemplate(String template, HttpRequest request, HttpResponse response, Class<? extends DTO<T>> dtoClass) -
Uses of HttpResponse in org.mockserver.testing.integration.callback
Fields in org.mockserver.testing.integration.callback declared as HttpResponseModifier and TypeFieldDescriptionstatic final HttpResponsePrecannedTestExpectationResponseCallback.httpResponsestatic HttpResponseStaticTestExpectationResponseCallback.httpResponseMethods in org.mockserver.testing.integration.callback that return HttpResponseModifier and TypeMethodDescriptionPrecannedTestExpectationForwardCallbackRequestAndResponse.handle(HttpRequest httpRequest, HttpResponse httpResponse) PrecannedTestExpectationResponseCallback.handle(HttpRequest httpRequest) StaticTestExpectationResponseCallback.handle(HttpRequest httpRequest) Methods in org.mockserver.testing.integration.callback with parameters of type HttpResponseModifier and TypeMethodDescriptionPrecannedTestExpectationForwardCallbackRequestAndResponse.handle(HttpRequest httpRequest, HttpResponse httpResponse) -
Uses of HttpResponse in org.mockserver.testing.integration.mock
Methods in org.mockserver.testing.integration.mock that return HttpResponseModifier and TypeMethodDescriptionprotected HttpResponseAbstractBasicMockingIntegrationTest.localNotFoundResponse()protected HttpResponseAbstractControlPlaneIntegrationTest.localNotFoundResponse()protected HttpResponseAbstractPackagingSmokeTest.localNotFoundResponse()protected HttpResponseAbstractTransportAgnosticSemanticsIntegrationTest.localNotFoundResponse()protected HttpResponseAbstractMockingIntegrationTestBase.makeRequest(HttpRequest httpRequest, Collection<String> headersToRemove) -
Uses of HttpResponse in org.mockserver.verify
Methods in org.mockserver.verify that return HttpResponseMethods in org.mockserver.verify that return types with arguments of type HttpResponseMethods in org.mockserver.verify with parameters of type HttpResponseModifier and TypeMethodDescriptionVerification.withResponse(HttpResponse httpResponse) VerificationSequence.withResponses(HttpResponse... httpResponses) Method parameters in org.mockserver.verify with type arguments of type HttpResponseModifier and TypeMethodDescriptionVerificationSequence.withResponses(List<HttpResponse> httpResponses)