public class UrlUtils
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
UrlUtils.ContentType |
Constructor and Description |
---|
UrlUtils() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
get(java.lang.String url)
Get the HTTP content for the URL as string.
|
byte[] |
getByteArray(java.lang.String url)
Get the HTTP content for the URL as byte array.
|
java.lang.String |
post(java.lang.String targetURL,
UrlUtils.ContentType contentType,
java.util.Map<java.lang.String,java.lang.String> headerParams,
java.lang.String payload)
Get the HTTP content for a POST HTTP URL.
|
public java.lang.String get(java.lang.String url) throws java.lang.Exception
url
- the URLjava.lang.Exception
- when the URL failspublic byte[] getByteArray(java.lang.String url) throws java.lang.Exception
url
- the URLjava.lang.Exception
- when the URL failspublic java.lang.String post(java.lang.String targetURL, UrlUtils.ContentType contentType, java.util.Map<java.lang.String,java.lang.String> headerParams, java.lang.String payload) throws java.lang.Exception
targetURL
- the POST HTTP URLcontentType
- content type of the URLheaderParams
- headers for the callpayload
- post payload informatonjava.lang.Exception
- when the URL fails