Tabnine Logo
DefaultFullHttpRequest.setUri
Code IndexAdd Tabnine to your IDE (free)

How to use
setUri
method
in
io.netty.handler.codec.http.DefaultFullHttpRequest

Best Java code snippets using io.netty.handler.codec.http.DefaultFullHttpRequest.setUri (Showing top 1 results out of 315)

origin: awslabs/mxnet-model-server

public boolean predict(
    String modelName, DefaultFullHttpRequest req, HttpPostRequestEncoder requestEncoder)
    throws InterruptedException, HttpPostRequestEncoder.ErrorDataEncoderException,
        IOException {
  Channel channel = connect(bootstrap, inferencePort);
  req.setUri("/predictions/" + URLEncoder.encode(modelName, StandardCharsets.UTF_8.name()));
  channel.writeAndFlush(requestEncoder.finalizeRequest());
  if (requestEncoder.isChunked()) {
    channel.writeAndFlush(requestEncoder).sync();
  }
  channel.closeFuture().sync();
  int statusCode = handler.getStatusCode();
  String ret = handler.getContent();
  if (statusCode == 200) {
    logger.info("predict: {} success.", modelName);
    logger.trace(ret);
    return true;
  }
  logger.warn("predict: {} failed: {}", modelName, ret);
  return false;
}
io.netty.handler.codec.httpDefaultFullHttpRequestsetUri

Popular methods of DefaultFullHttpRequest

  • <init>
  • headers
  • content
  • trailingHeaders
  • decoderResult
  • method
  • protocolVersion
  • replace
  • setDecoderResult
  • uri
  • retain
  • copy
  • retain,
  • copy,
  • equals,
  • refCnt,
  • release

Popular in Java

  • Creating JSON documents from java classes using gson
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • addToBackStack (FragmentTransaction)
  • setRequestProperty (URLConnection)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Socket (java.net)
    Provides a client-side TCP socket.
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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