# HttpExtension (dapr-sdk-parent 1.10.0 API)

Package io.dapr.client.domain

## Class HttpExtension

- java.lang.Object
- - io.dapr.client.domain.HttpExtension

    public final class HttpExtension
    extends Object

HTTP Extension class. This class is only needed if the app you are calling is listening on HTTP. It contains properties that represent data that may be populated for an HTTP receiver.

### Field Summary

Fields
`static HttpExtension` `CONNECT` Convenience HttpExtension object for the `DaprHttp.HttpMethods.CONNECT` Verb with empty queryString.
`static HttpExtension` `DELETE` Convenience HttpExtension object for the `DaprHttp.HttpMethods.DELETE` Verb with empty queryString.
`static HttpExtension` `GET` Convenience HttpExtension object for the `DaprHttp.HttpMethods.GET` Verb with empty queryString.
`static HttpExtension` `HEAD` Convenience HttpExtension object for the `DaprHttp.HttpMethods.HEAD` Verb with empty queryString.
`static HttpExtension` `NONE` Convenience HttpExtension object for `DaprHttp.HttpMethods.NONE` with empty queryString.
`static HttpExtension` `OPTIONS` Convenience HttpExtension object for the `DaprHttp.HttpMethods.OPTIONS` Verb with empty queryString.
`static HttpExtension` `POST` Convenience HttpExtension object for the `DaprHttp.HttpMethods.POST` Verb with empty queryString.
`static HttpExtension` `PUT` Convenience HttpExtension object for the `DaprHttp.HttpMethods.PUT` Verb with empty queryString.
`static HttpExtension` `TRACE` Convenience HttpExtension object for the `DaprHttp.HttpMethods.TRACE` Verb with empty queryString.

### Constructor Summary

Constructors
`HttpExtension​(DaprHttp.HttpMethods method)` Construct a HttpExtension object.
`HttpExtension​(DaprHttp.HttpMethods method, Map<String,​List<String>> queryParams, Map<String,​String> headers)` Construct a HttpExtension object.

### Method Summary

All Methods Instance Methods Concrete Methods
`String` `encodeQueryString()` Encodes the query string for the HTTP request.
`Map<String,​String>` `getHeaders()`
`DaprHttp.HttpMethods` `getMethod()`
`Map<String,​List<String>>` `getQueryParams()`

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

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

### Field Detail

#### NONE

    public static final HttpExtension NONE

Convenience HttpExtension object for `DaprHttp.HttpMethods.NONE` with empty queryString.

#### GET

    public static final HttpExtension GET

Convenience HttpExtension object for the `DaprHttp.HttpMethods.GET` Verb with empty queryString.

#### PUT

    public static final HttpExtension PUT

Convenience HttpExtension object for the `DaprHttp.HttpMethods.PUT` Verb with empty queryString.

#### POST

    public static final HttpExtension POST

Convenience HttpExtension object for the `DaprHttp.HttpMethods.POST` Verb with empty queryString.

#### DELETE

    public static final HttpExtension DELETE

Convenience HttpExtension object for the `DaprHttp.HttpMethods.DELETE` Verb with empty queryString.

#### HEAD

    public static final HttpExtension HEAD

Convenience HttpExtension object for the `DaprHttp.HttpMethods.HEAD` Verb with empty queryString.

#### CONNECT

    public static final HttpExtension CONNECT

Convenience HttpExtension object for the `DaprHttp.HttpMethods.CONNECT` Verb with empty queryString.

#### OPTIONS

    public static final HttpExtension OPTIONS

Convenience HttpExtension object for the `DaprHttp.HttpMethods.OPTIONS` Verb with empty queryString.

#### TRACE

    public static final HttpExtension TRACE

Convenience HttpExtension object for the `DaprHttp.HttpMethods.TRACE` Verb with empty queryString.

### Constructor Detail

#### HttpExtension

    public HttpExtension​(DaprHttp.HttpMethods method,
                         Map<String,​List<String>> queryParams,
                         Map<String,​String> headers)

Construct a HttpExtension object.

Parameters:
  `method` - Required value denoting the HttpMethod.
  `queryParams` - map for the query parameters the HTTP call.
  `headers` - map to set HTTP headers.
Throws:
  `IllegalArgumentException` - on null method or queryString.
See Also:
  `for supported methods.`

#### HttpExtension

    public HttpExtension​(DaprHttp.HttpMethods method)

Construct a HttpExtension object.

Parameters:
  `method` - Required value denoting the HttpMethod.
Throws:
  `IllegalArgumentException` - on null method or queryString.
See Also:
  `for supported methods.`

### Method Detail

#### getMethod

    public DaprHttp.HttpMethods getMethod()

#### getQueryParams

    public Map<String,​List<String>> getQueryParams()

#### getHeaders

    public Map<String,​String> getHeaders()

#### encodeQueryString

    public String encodeQueryString()

Encodes the query string for the HTTP request.

Returns:
  Encoded HTTP query string.