Uses of Class
io.karatelabs.http.HttpResponse
Packages that use HttpResponse
-
Uses of HttpResponse in io.karatelabs.core
Methods in io.karatelabs.core that return HttpResponseModifier and TypeMethodDescriptionMockHandler.apply(HttpRequest request) HttpRunEvent.response()Returns the value of theresponserecord component.Methods in io.karatelabs.core with parameters of type HttpResponseModifier and TypeMethodDescriptionstatic HttpRunEventHttpRunEvent.exit(HttpRequest request, HttpResponse response, ScenarioRuntime sr) Creates an HTTP_EXIT event fired after the HTTP response is received.voidKarateJs.setPrevResponse(HttpResponse response) Track the previous HTTP response, used to back karate.response in non-mock context.Constructors in io.karatelabs.core with parameters of type HttpResponseModifierConstructorDescriptionHttpRunEvent(RunEventType type, HttpRequest request, HttpResponse response, ScenarioRuntime scenarioRuntime, long timeStamp) Creates an instance of aHttpRunEventrecord class. -
Uses of HttpResponse in io.karatelabs.http
Methods in io.karatelabs.http that return HttpResponseModifier and TypeMethodDescriptionServerRequestHandler.apply(HttpRequest request) static HttpResponseHttpResponse.badRequest(String message) Shortcut forerror(400, message).static HttpResponseHttpResponse.binary(byte[] body) 200 OK+application/octet-stream.Http.delete()static HttpResponseStatus + JSON body{"error": message}.Http.get()ServerMarkupContext.getResponse()ServerRequestCycle.getResponse()ServerRequestCycle.handle()Main entry point - routes to API or HTML handler.static HttpResponse200 OK+text/html.ApacheHttpClient.invoke(HttpRequest request) HttpClient.invoke(HttpRequest request) HttpRequestBuilder.invoke()static HttpResponseStatus +application/json.static HttpResponse200 OK+application/json.Http.methodJson(String method, String body) static HttpResponseHttpResponse.noContent()204 No Content.static HttpResponseShortcut forerror(404, message).static HttpResponseHttpResponse.ok()200 OKwith no body.static HttpResponse200 OKwith body type inferred (matches the JS-mock dispatch):String→text/plain,Map/List→application/json,Node→application/xml,byte[]→no Content-Type.Forward this request to a target URL and return the response.static HttpResponseCustom redirect status (301 / 303 / 307 / 308) +Locationheader.static HttpResponse302 Found+Locationheader.static HttpResponseHttpResponse.skipped(HttpRequest request) Creates a skipped response for when a listener returns false from HTTP_ENTER.static HttpResponseStatus +text/plain.static HttpResponse200 OK+text/plain.static HttpResponse200 OK+application/xml.Methods in io.karatelabs.http that return types with arguments of type HttpResponseMethods in io.karatelabs.http with parameters of type HttpResponseModifier and TypeMethodDescriptionstatic voidSecurityHeaders.apply(HttpResponse response, ServerConfig config) Apply security headers to an HTTP response based on the server configuration.Method parameters in io.karatelabs.http with type arguments of type HttpResponseModifier and TypeMethodDescriptionServerConfig.requestFilter(BiFunction<HttpRequest, ServerMarkupContext, HttpResponse> requestFilter) Set a request filter that runs after session loading but before CSRF validation.static HttpServerHttpServer.start(int port, io.netty.handler.ssl.SslContext sslContext, Function<HttpRequest, HttpResponse> handler) static HttpServerHttpServer.start(int port, io.netty.handler.ssl.SslContext sslContext, Function<HttpRequest, HttpResponse> handler, SseHandler sseHandler) static HttpServerHttpServer.start(int port, io.netty.handler.ssl.SslContext sslContext, Function<HttpRequest, HttpResponse> handler, SseHandler sseHandler, WsHandler wsHandler) static HttpServerHttpServer.start(int port, Function<HttpRequest, HttpResponse> handler) static HttpServerHttpServer.start(int port, Function<HttpRequest, HttpResponse> handler, SseHandler sseHandler) static HttpServerHttpServer.start(int port, Function<HttpRequest, HttpResponse> handler, SseHandler sseHandler, WsHandler wsHandler) static HttpServerHttpServer.start(String host, int port, Function<HttpRequest, HttpResponse> handler, SseHandler sseHandler, WsHandler wsHandler) Start bound to a specific interface —host="localhost"/"127.0.0.1"listens on loopback only (not reachable off-box),"0.0.0.0"/null/blank listens on every interface (the historical default).Constructors in io.karatelabs.http with parameters of type HttpResponseModifierConstructorDescriptionServerMarkupContext(HttpRequest request, HttpResponse response, ServerConfig config) -
Uses of HttpResponse in io.karatelabs.output
Methods in io.karatelabs.output with parameters of type HttpResponseModifier and TypeMethodDescriptionstatic StringHttpLogger.getStatusFailureMessage(int expected, HttpRequest request, HttpResponse response) voidHttpLogger.logResponse(HttpResponse response)