com.braintreegateway.util
Class Http

java.lang.Object
  extended by com.braintreegateway.util.Http

public class Http
extends Object


Nested Class Summary
(package private) static class Http.RequestMethod
           
 
Field Summary
private  String authorizationHeader
           
private  String baseMerchantURL
           
private  String[] certificateFilenames
           
private  String version
           
 
Constructor Summary
Http(String authorizationHeader, String baseMerchantURL, String[] certificateFilenames, String version)
           
 
Method Summary
private  HttpURLConnection buildConnection(Http.RequestMethod requestMethod, String urlString)
           
 void delete(String url)
           
 NodeWrapper get(String url)
           
private  SSLSocketFactory getSSLSocketFactory()
           
private  NodeWrapper httpRequest(Http.RequestMethod requestMethod, String url)
           
private  NodeWrapper httpRequest(Http.RequestMethod requestMethod, String url, String postBody)
           
private static boolean isErrorCode(int responseCode)
           
 NodeWrapper post(String url)
           
 NodeWrapper post(String url, Request request)
           
 NodeWrapper put(String url)
           
 NodeWrapper put(String url, Request request)
           
static void throwExceptionIfErrorStatusCode(int statusCode, String message)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

authorizationHeader

private String authorizationHeader

baseMerchantURL

private String baseMerchantURL

certificateFilenames

private String[] certificateFilenames

version

private String version
Constructor Detail

Http

public Http(String authorizationHeader,
            String baseMerchantURL,
            String[] certificateFilenames,
            String version)
Method Detail

delete

public void delete(String url)

get

public NodeWrapper get(String url)

post

public NodeWrapper post(String url)

post

public NodeWrapper post(String url,
                        Request request)

put

public NodeWrapper put(String url)

put

public NodeWrapper put(String url,
                       Request request)

httpRequest

private NodeWrapper httpRequest(Http.RequestMethod requestMethod,
                                String url)

httpRequest

private NodeWrapper httpRequest(Http.RequestMethod requestMethod,
                                String url,
                                String postBody)

getSSLSocketFactory

private SSLSocketFactory getSSLSocketFactory()

buildConnection

private HttpURLConnection buildConnection(Http.RequestMethod requestMethod,
                                          String urlString)
                                   throws IOException
Throws:
IOException

throwExceptionIfErrorStatusCode

public static void throwExceptionIfErrorStatusCode(int statusCode,
                                                   String message)

isErrorCode

private static boolean isErrorCode(int responseCode)


Copyright © 2013. All Rights Reserved.