public class HttpUtil extends Object
Constructor and Description |
---|
HttpUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
encodeIncludingSpecialCharacters(String toEncode)
Some calls in the Heroku API decode strings in a different way from URLEncoder.
|
static String |
encodeParameters(RequestConfig config,
Heroku.RequestKey... keys)
URL encode request paramaters from a
RequestConfig . |
static byte[] |
getBytes(InputStream in)
Converts an
InputStream to a byte array |
static String |
getUTF8String(byte[] in) |
static RequestFailedException |
insufficientPrivileges(int code,
byte[] bytes) |
static UnsupportedOperationException |
noBody() |
static URL |
toURL(String url) |
static String |
urlencode(String toEncode,
String messageIfFails) |
public static String encodeParameters(RequestConfig config, Heroku.RequestKey... keys)
RequestConfig
.config
- Name/value pairs for a HTTP request.keys
- List of keys in the config to encode.public static String encodeIncludingSpecialCharacters(String toEncode)
toEncode
- string to encodepublic static UnsupportedOperationException noBody()
public static RequestFailedException insufficientPrivileges(int code, byte[] bytes)
public static byte[] getBytes(InputStream in)
InputStream
to a byte arrayin
- input stream to convertpublic static String getUTF8String(byte[] in)
Copyright © 2017. All rights reserved.