Skip navigation links

Oracle Fusion Middleware Java API Reference for the Oracle Access Management OAuth Service
11g Release 2 Patch Set 3 (11.1.2.3)

E59498-01


oracle.security.idaas.oauth.sdk.http
Class HttpUtil

java.lang.Object
  extended by oracle.security.idaas.oauth.sdk.http.HttpUtil


public class HttpUtil
extends java.lang.Object

Util class to handle HTTP request and response.


Nested Class Summary

static class HttpUtil.OAuthClientHostnameVerifier
          Pass through Verifier implementation class, it returns always true.

  Constructor Summary

HttpUtil()
           

  Method Summary

static HttpResponse doHttpRequest(java.lang.String urlStr, java.lang.String requestMethod, java.lang.String body, java.util.Map<java.lang.String,java.lang.String> header, java.lang.String useProxy, java.lang.String proxyHost, java.lang.String proxyPort)
          Handle the request.
static void setConnectTimeout(int timeout)
          Changes the connection timeout in millseconds.

  Methods inherited from class java.lang.Object

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

 

Constructor Detail

HttpUtil

public HttpUtil()

Method Detail

setConnectTimeout

public static void setConnectTimeout(int timeout)
Changes the connection timeout in millseconds. The default value is already set to 5000 milliseconds.
Parameters:
timeout - an int that specifies the connect timeout value in milliseconds

doHttpRequest

public static HttpResponse doHttpRequest(java.lang.String urlStr,
                                         java.lang.String requestMethod,
                                         java.lang.String body,
                                         java.util.Map<java.lang.String,java.lang.String> header,
                                         java.lang.String useProxy,
                                         java.lang.String proxyHost,
                                         java.lang.String proxyPort)
                                  throws java.io.IOException,
                                         javax.net.ssl.SSLException
Handle the request.
Parameters:
urlStr - the URL
requestMethod - POST, GET, DELETE, PUT
body - the body content string
header - the list of attribute name and value pairs
useProxy - true if a proxy shall be used
proxyHost - the hostname, or address, of the proxy server
proxyPort - the port number of the proxy server
Returns:
the response
Throws:
java.io.IOException - if an I/O error occurs.
javax.net.ssl.SSLException - may be thrown when the url use SSL via HTTPS.

Skip navigation links

Copyright (c) 2014, 2015,
Oracle and/or its affiliates. All Rights Reserved.