io.vertx.core.http

## Class RequestOptions

- java.lang.Object
- - io.vertx.core.http.RequestOptions

- Direct Known Subclasses:
    WebSocketConnectOptions

      public class RequestOptions
      extends Object

  Options describing how an `HttpClient` will make connect to make a request.
  Author:
    Julien Viet

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `DEFAULT_HOST` The default value for host name = "localhost"
    `static int` | `DEFAULT_PORT` The default value for port = 80
    `static Boolean` | `DEFAULT_SSL` SSL enabled by default = false
    `static String` | `DEFAULT_URI` The default relative request URI = ""

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RequestOptions()` Default constructor
    `RequestOptions(JsonObject json)` Create options from JSON
    `RequestOptions(RequestOptions other)` Copy constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `RequestOptions` | `addHeader(String key, String value)` Add a request header.
    `MultiMap` | `getHeaders()` Get the request headers
    `String` | `getHost()` Get the host name to be used by the client request.
    `int` | `getPort()` Get the port to be used by the client request.
    `String` | `getURI()`
    `Boolean` | `isSsl()`
    `RequestOptions` | `setHeaders(MultiMap headers)` Set request headers from a multi-map.
    `RequestOptions` | `setHost(String host)` Set the host name to be used by the client request.
    `RequestOptions` | `setPort(int port)` Set the port to be used by the client request.
    `RequestOptions` | `setSsl(Boolean ssl)` Set whether SSL/TLS is enabled
    `RequestOptions` | `setURI(String uri)` Set the request relative URI
    `JsonObject` | `toJson()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_HOST

          public static final String DEFAULT_HOST

      The default value for host name = "localhost"
      See Also:
        Constant Field Values

    - #### DEFAULT_PORT

          public static final int DEFAULT_PORT

      The default value for port = 80
      See Also:
        Constant Field Values

    - #### DEFAULT_SSL

          public static final Boolean DEFAULT_SSL

      SSL enabled by default = false

    - #### DEFAULT_URI

          public static final String DEFAULT_URI

      The default relative request URI = ""
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### RequestOptions

          public RequestOptions()

      Default constructor

    - #### RequestOptions

          public RequestOptions(RequestOptions other)

      Copy constructor
      Parameters:
        `other` - the options to copy

    - #### RequestOptions

          public RequestOptions(JsonObject json)

      Create options from JSON
      Parameters:
        `json` - the JSON

  - ### Method Detail

    - #### getHost

          public String getHost()

      Get the host name to be used by the client request.
      Returns:
        the host name

    - #### setHost

          public RequestOptions setHost(String host)

      Set the host name to be used by the client request.
      Returns:
        a reference to this, so the API can be used fluently

    - #### getPort

          public int getPort()

      Get the port to be used by the client request.
      Returns:
        the port

    - #### setPort

          public RequestOptions setPort(int port)

      Set the port to be used by the client request.
      Returns:
        a reference to this, so the API can be used fluently

    - #### isSsl

          public Boolean isSsl()

      Returns:
        is SSL/TLS enabled?

    - #### setSsl

          public RequestOptions setSsl(Boolean ssl)

      Set whether SSL/TLS is enabled
      Parameters:
        `ssl` - true if enabled
      Returns:
        a reference to this, so the API can be used fluently

    - #### getURI

          public String getURI()

      Returns:
        the request relative URI

    - #### setURI

          public RequestOptions setURI(String uri)

      Set the request relative URI
      Parameters:
        `uri` - the relative uri
      Returns:
        a reference to this, so the API can be used fluently

    - #### addHeader

          public RequestOptions addHeader(String key,
                                          String value)

      Add a request header.
      Parameters:
        `key` - the header key
        `value` - the header value
      Returns:
        a reference to this, so the API can be used fluently

    - #### setHeaders

          public RequestOptions setHeaders(MultiMap headers)

      Set request headers from a multi-map.
      Parameters:
        `headers` - the headers
      Returns:
        a reference to this, so the API can be used fluently

    - #### getHeaders

          public MultiMap getHeaders()

      Get the request headers
      Returns:
        the headers

    - #### toJson

          public JsonObject toJson()

Copyright © 2019 Eclipse. All rights reserved.