org.keycloak.broker.provider.util

## Class SimpleHttp

- java.lang.Object
- - org.keycloak.broker.provider.util.SimpleHttp

-     public class SimpleHttp
      extends Object

  Author:
    Stian Thorgersen, Vlastimil Elias (velias at redhat dot com), David Klassen (daviddd.kl@gmail.com)

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `SimpleHttp.Response`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `SimpleHttp(String url, String method, org.apache.http.client.HttpClient client)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `SimpleHttp` | `acceptJson()`
    `com.fasterxml.jackson.databind.JsonNode` | `asJson()`
    `<T> T` | `asJson(Class<T> type)`
    `<T> T` | `asJson(com.fasterxml.jackson.core.type.TypeReference<T> type)`
    `SimpleHttp.Response` | `asResponse()`
    `int` | `asStatus()`
    `String` | `asString()`
    `SimpleHttp` | `auth(String token)`
    `SimpleHttp` | `authBasic(String username, String password)`
    `SimpleHttp` | `connectionRequestTimeoutMillis(int timeout)`
    `SimpleHttp` | `connectTimeoutMillis(int timeout)`
    `static SimpleHttp` | `doDelete(String url, org.apache.http.client.HttpClient client)`
    `static SimpleHttp` | `doDelete(String url, KeycloakSession session)`
    `static SimpleHttp` | `doGet(String url, org.apache.http.client.HttpClient client)`
    `static SimpleHttp` | `doGet(String url, KeycloakSession session)`
    `static SimpleHttp` | `doHead(String url, org.apache.http.client.HttpClient client)`
    `static SimpleHttp` | `doPatch(String url, org.apache.http.client.HttpClient client)`
    `static SimpleHttp` | `doPost(String url, org.apache.http.client.HttpClient client)`
    `static SimpleHttp` | `doPost(String url, KeycloakSession session)`
    `static SimpleHttp` | `doPut(String url, org.apache.http.client.HttpClient client)`
    `SimpleHttp` | `header(String name, String value)`
    `SimpleHttp` | `json(Object entity)`
    `SimpleHttp` | `param(String name, String value)`
    `SimpleHttp` | `socketTimeOutMillis(int timeout)`

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

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

- - ### Constructor Detail

    - #### SimpleHttp

          protected SimpleHttp(String url,
                               String method,
                               org.apache.http.client.HttpClient client)

  - ### Method Detail

    - #### doDelete

          public static SimpleHttp doDelete(String url,
                                            KeycloakSession session)

    - #### doDelete

          public static SimpleHttp doDelete(String url,
                                            org.apache.http.client.HttpClient client)

    - #### doGet

          public static SimpleHttp doGet(String url,
                                         KeycloakSession session)

    - #### doGet

          public static SimpleHttp doGet(String url,
                                         org.apache.http.client.HttpClient client)

    - #### doPost

          public static SimpleHttp doPost(String url,
                                          KeycloakSession session)

    - #### doPost

          public static SimpleHttp doPost(String url,
                                          org.apache.http.client.HttpClient client)

    - #### doPut

          public static SimpleHttp doPut(String url,
                                         org.apache.http.client.HttpClient client)

    - #### doHead

          public static SimpleHttp doHead(String url,
                                          org.apache.http.client.HttpClient client)

    - #### doPatch

          public static SimpleHttp doPatch(String url,
                                           org.apache.http.client.HttpClient client)

    - #### header

          public SimpleHttp header(String name,
                                   String value)

    - #### json

          public SimpleHttp json(Object entity)

    - #### param

          public SimpleHttp param(String name,
                                  String value)

    - #### socketTimeOutMillis

          public SimpleHttp socketTimeOutMillis(int timeout)

    - #### connectTimeoutMillis

          public SimpleHttp connectTimeoutMillis(int timeout)

    - #### connectionRequestTimeoutMillis

          public SimpleHttp connectionRequestTimeoutMillis(int timeout)

    - #### auth

          public SimpleHttp auth(String token)

    - #### authBasic

          public SimpleHttp authBasic(String username,
                                      String password)

    - #### acceptJson

          public SimpleHttp acceptJson()

    - #### asJson

          public com.fasterxml.jackson.databind.JsonNode asJson()
                                                         throws IOException

      Throws:
        `IOException`

    - #### asJson

          public <T> T asJson(Class<T> type)
                       throws IOException

      Throws:
        `IOException`

    - #### asJson

          public <T> T asJson(com.fasterxml.jackson.core.type.TypeReference<T> type)
                       throws IOException

      Throws:
        `IOException`

    - #### asString

          public String asString()
                          throws IOException

      Throws:
        `IOException`

    - #### asStatus

          public int asStatus()
                       throws IOException

      Throws:
        `IOException`

    - #### asResponse

          public SimpleHttp.Response asResponse()
                                         throws IOException

      Throws:
        `IOException`

Copyright © 2020 JBoss by Red Hat. All rights reserved.