com.heroku.api.http
Class HttpUtil
java.lang.Object
com.heroku.api.http.HttpUtil
public class HttpUtil
- extends java.lang.Object
HTTP related utilities.
- Author:
- Naaman Newbold
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HttpUtil
public HttpUtil()
encodeParameters
public static java.lang.String encodeParameters(RequestConfig config,
Heroku.RequestKey... keys)
- URL encode request paramaters from a
RequestConfig
.
- Parameters:
config
- Name/value pairs for a HTTP request.keys
- List of keys in the config to encode.
- Returns:
- A string representation of encoded name/value parameters.
urlencode
public static java.lang.String urlencode(java.lang.String toEncode,
java.lang.String messageIfFails)
noBody
public static java.lang.UnsupportedOperationException noBody()
toURL
public static java.net.URL toURL(java.lang.String url)
insufficientPrivileges
public static RequestFailedException insufficientPrivileges(int code,
byte[] bytes)
getBytes
public static byte[] getBytes(java.io.InputStream in)
- Converts an
InputStream
to a byte array
- Parameters:
in
-
- Returns:
getUTF8String
public static java.lang.String getUTF8String(byte[] in)
Copyright © 2012. All Rights Reserved.