io.vertx.ext.auth.oauth2

## Interface OAuth2Response

-     public interface OAuth2Response

  A response from a fetch request. This class represents a secure response from a Oauth2 fetch call. A fetch is a simplified HTTP response from a protected resource.
  Author:
    Paulo Lopes

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `Buffer` | `body()` The HTTP response body as a buffer
    `String` | `getHeader(String name)` Looks up a HTTP response header by name, in case where the response is a list of headers, the first one is returned.
    `MultiMap` | `headers()` The HTTP response headers from the HTTP layer.
    `boolean` | `is(String contentType)` Helper to analize the response body.
    `JsonArray` | `jsonArray()` The HTTP response body as a JsonArray
    `JsonObject` | `jsonObject()` The HTTP response body as a JsonObject
    `int` | `statusCode()` the returned status code from the HTTP layer.

- - ### Method Detail

    - #### statusCode

          int statusCode()

      the returned status code from the HTTP layer.
      Returns:
        HTTP status code

    - #### headers

          MultiMap headers()

      The HTTP response headers from the HTTP layer.
      Returns:
        the HTTP headers

    - #### getHeader

          String getHeader(String name)

      Looks up a HTTP response header by name, in case where the response is a list of headers, the first one is returned.
      Parameters:
        `name` - of the header to look up
      Returns:
        the single value for the header.

    - #### body

          Buffer body()

      The HTTP response body as a buffer
      Returns:
        a buffer with the HTTP response body

    - #### jsonObject

          JsonObject jsonObject()

      The HTTP response body as a JsonObject
      Returns:
        a JsonObject from the HTTP response body

    - #### jsonArray

          JsonArray jsonArray()

      The HTTP response body as a JsonArray
      Returns:
        a JsonArray from the HTTP response body

    - #### is

          boolean is(String contentType)

      Helper to analize the response body. The test is performed against the header Content-Type, the content of the body is not analyzed.
      Parameters:
        `contentType` - a content type to test, e.g.: application/json
      Returns:
        true if the header matches

Copyright © 2018 Eclipse. All rights reserved.