congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
HttpServerResponse.send
Code IndexAdd Tabnine to your IDE (free)

How to use
send
method
in
reactor.netty.http.server.HttpServerResponse

Best Java code snippets using reactor.netty.http.server.HttpServerResponse.send (Showing top 20 results out of 315)

origin: spring-projects/spring-framework

@Override
protected Mono<Void> writeWithInternal(Publisher<? extends DataBuffer> publisher) {
  return this.response.send(toByteBufs(publisher)).then();
}
origin: org.springframework/spring-web

@Override
protected Mono<Void> writeWithInternal(Publisher<? extends DataBuffer> publisher) {
  return this.response.send(toByteBufs(publisher)).then();
}
origin: reactor/reactor-netty

@Override
public Mono<Void> sendNotFound() {
  return this.status(HttpResponseStatus.NOT_FOUND)
        .send();
}
origin: io.projectreactor.netty/reactor-netty

@Override
public Mono<Void> sendNotFound() {
  return this.status(HttpResponseStatus.NOT_FOUND)
        .send();
}
origin: apache/servicemix-bundles

@Override
protected Mono<Void> writeWithInternal(Publisher<? extends DataBuffer> publisher) {
  Publisher<ByteBuf> body = toByteBufs(publisher);
  return this.response.send(body).then();
}
origin: scalecube/scalecube-services

private Mono<Void> noContent(HttpServerResponse httpResponse) {
 return httpResponse.status(NO_CONTENT).send();
}
origin: io.scalecube/scalecube-gateway-http

private Mono<Void> noContent(HttpServerResponse httpResponse) {
 return httpResponse.status(NO_CONTENT).send();
}
origin: reactor/reactor-netty

@Override
public Mono<Void> sendRedirect(String location) {
  Objects.requireNonNull(location, "location");
  return this.status(HttpResponseStatus.FOUND)
        .header(HttpHeaderNames.LOCATION, location)
        .send();
}
origin: io.projectreactor.netty/reactor-netty

@Override
public Mono<Void> sendRedirect(String location) {
  Objects.requireNonNull(location, "location");
  return this.status(HttpResponseStatus.FOUND)
        .header(HttpHeaderNames.LOCATION, location)
        .send();
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-web

@Override
protected Mono<Void> writeWithInternal(Publisher<? extends DataBuffer> publisher) {
  return this.response.send(toByteBufs(publisher)).then();
}
origin: scalecube/scalecube-services

private Publisher<Void> methodNotAllowed(HttpServerResponse httpResponse) {
 return httpResponse.addHeader(ALLOW, POST.name()).status(METHOD_NOT_ALLOWED).send();
}
origin: io.scalecube/scalecube-gateway-http

private Publisher<Void> methodNotAllowed(HttpServerResponse httpResponse) {
 return httpResponse.addHeader(ALLOW, POST.name()).status(METHOD_NOT_ALLOWED).send();
}
origin: reactor/reactor-netty

@Test
public void testDropPublisher() {
  ByteBuf data = ByteBufAllocator.DEFAULT.buffer();
  data.writeCharSequence("test", Charset.defaultCharset());
  doTestDropData(
      (req, res) -> res.header("Content-Length", "0")
               .send(Mono.fromRunnable(() -> Flux.just(data, data.retain(), data.retain())))
               .then()
               .doOnCancel(() -> ReferenceCountUtil.release(data)),
      (req, out) -> out);
  assertThat(ReferenceCountUtil.refCnt(data)).isEqualTo(0);
}
origin: reactor/reactor-netty

@Test
public void testDropPublisherConnectionClose() {
  ByteBuf data = ByteBufAllocator.DEFAULT.buffer();
  data.writeCharSequence("test", Charset.defaultCharset());
  doTestDropData(
      (req, res) -> res.header("Content-Length", "0")
               .send(Mono.fromRunnable(() -> Flux.just(data, data.retain(), data.retain())))
               .then()
               .doOnCancel(() -> ReferenceCountUtil.release(data)),
      (req, out) -> {
        req.addHeader("Connection", "close");
        return out;
      });
  assertThat(ReferenceCountUtil.refCnt(data)).isEqualTo(0);
}
origin: reactor/reactor-netty

private Mono<Void> proxy(HttpServerRequest request, HttpServerResponse response) {
  return HttpClient.create()
           .wiretap(true)
           .headers(h -> h.add(filterRequestHeaders(request.requestHeaders())))
           .get()
           .uri(URI.create("http://localhost:" + CONTENT_SERVER_PORT +
                   "/" + request.path())
               .toString())
           .response((targetResponse, buf) -> response.headers(filterResponseHeaders(targetResponse.responseHeaders()))
                            .send(buf.retain())
                            .then())
           .then();
}
origin: reactor/reactor-netty

@Test(timeout = 10000)
public void testHang() {
  DisposableServer httpServer =
      HttpServer.create()
           .port(0)
           .host("0.0.0.0")
           .route(r -> r.get("/data", (request, response) -> response.send(Mono.empty())))
           .wiretap(true)
           .bindNow();
  assertNotNull(httpServer);
  httpServer.disposeNow();
}
origin: reactor/reactor-netty

@Test
@Ignore
public void proxyTest() {
  HttpServer server = HttpServer.create();
  server.route(r -> r.get("/search/{search}",
              (in, out) -> HttpClient.create()
                          .wiretap(true)
                          .get()
                          .uri("foaas.herokuapp.com/life/" + in.param("search"))
                          .response((repliesOut, buf) -> out.send(buf))))
     .wiretap(true)
     .bindNow()
     .onDispose()
     .block(Duration.ofSeconds(30));
}
origin: reactor/reactor-netty

@Test
public void clientWithoutCookieGetsANewOneFromServer() {
  DisposableServer server =
      HttpServer.create()
           .port(0)
           .route(r -> r.get("/test", (req, resp) ->
                    resp.addCookie(new DefaultCookie("cookie1", "test_value"))
                      .send(req.receive()
                           .log("server received"))))
           .wiretap(true)
           .bindNow();
  Mono<Map<CharSequence, Set<Cookie>>> cookieResponse =
      HttpClient.create()
           .port(server.port())
           .wiretap(true)
           .get()
           .uri("/test")
           .responseSingle((res, buf) -> Mono.just(res.cookies()))
           .doOnSuccess(System.out::println)
           .doOnError(t -> System.err.println("Failed requesting server: " + t.getMessage()));
  StepVerifier.create(cookieResponse)
        .expectNextMatches(l -> {
          Set<Cookie> cookies = l.get("cookie1");
          return cookies.stream().anyMatch(e -> e.value().equals("test_value"));
        })
        .expectComplete()
        .verify(Duration.ofSeconds(30));
  server.disposeNow();
}
origin: reactor/reactor-netty

@Test
@Ignore
public void testIssue395() throws Exception {
  BiFunction<HttpServerRequest, HttpServerResponse, Mono<Void>> echoHandler =
      (req, res) -> res.send(req.receive().map(ByteBuf::retain)).then();
  SelfSignedCertificate cert = new SelfSignedCertificate();
  SslContextBuilder serverOptions = SslContextBuilder.forServer(cert.certificate(), cert.privateKey());
  DisposableServer server =
      HttpServer.create()
           .secure(ssl -> ssl.sslContext(serverOptions))
           .protocol(HttpProtocol.H2)
           .handle(echoHandler)
           .port(8080)
           .wiretap(true)
           .bindNow();
  new CountDownLatch(1).await();
  server.disposeNow();
}
origin: reactor/reactor-netty

@Test
public void testIssue186() {
  DisposableServer server =
      HttpServer.create()
           .port(0)
           .handle((req, res) -> res.status(200).send())
           .wiretap(true)
           .bindNow();
  HttpClient client =
      HttpClient.create(ConnectionProvider.fixed("test", 1))
           .addressSupplier(server::address)
           .wiretap(true);
  try {
    doTestIssue186(client);
    doTestIssue186(client);
  }
  finally {
    server.disposeNow();
  }
}
reactor.netty.http.serverHttpServerResponsesend

Javadoc

Send headers and empty content thus delimiting a full empty body http response.

Popular methods of HttpServerResponse

  • status
  • responseHeaders
    Return headers sent back to the clients
  • sendWebsocket
    Upgrade connection to Websocket. Mono and Callback are invoked on handshake success, otherwise the r
  • sendFile
  • header
    Set an outbound header, replacing any pre-existing value.
  • addCookie
    Add an outbound cookie
  • addHeader
    Add an outbound http header, appending the value if the header already exist.
  • alloc
  • sendGroups
  • sendNotFound
    Send 404 status HttpResponseStatus#NOT_FOUND.
  • sendObject
  • sendString
  • sendObject,
  • sendString,
  • chunkedTransfer,
  • compression,
  • headers,
  • options,
  • sendByteArray,
  • sendFileChunked,
  • sendHeaders

Popular in Java

  • Creating JSON documents from java classes using gson
  • findViewById (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getApplicationContext (Context)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • BoxLayout (javax.swing)
  • Join (org.hibernate.mapping)
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now