|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Objectcom.wowza.util.HTTPUtils
public class HTTPUtils
HTTPUtils: utility class for making http requests.
| Field Summary | |
|---|---|
static org.apache.commons.lang.time.FastDateFormat |
COOKIEDATEFORMAT
|
| Constructor Summary | |
|---|---|
HTTPUtils()
|
|
| Method Summary | |
|---|---|
static String |
assembleQueryStr(java.util.Map<String,String> queryMap)
Assemble a map of name value pairs into a single query string. |
static String |
formatDeleteCookie(String name,
String path,
String domain)
Formats a cookie header value that is in the past to delete a cookie |
static String |
formatSetCookie(String name,
String value,
int timeoffset,
String path,
String domain,
boolean isSecure)
Format a HTTP header Set-Cookie value |
static byte[] |
HTTPRequestToByteArray(String inUrl,
String method,
String data,
java.util.Map<String,String> headers)
Make a HTTP request and return the result as a byte array |
static byte[] |
HTTPRequestToByteArray(String inUrl,
String method,
String data,
java.util.Map<String,String> inHeaders,
java.util.Map<String,java.util.List<String>> outHeaders,
long dataLimit)
Make a HTTP request and return the result as a byte array |
static boolean |
HTTPRequestToFile(java.io.File file,
String inUrl,
String method,
String data,
java.util.List headers)
Make a HTTP request and have the result saved to a file. |
static java.util.List<String[]> |
splitCookie(String str)
Breaks Cookies header value into a list of name/value pairs. |
static String[] |
splitPragmas(String str)
Split HTTP Pragma values at commas that separate values. |
static java.util.Map<String,String> |
splitQueryStr(String queryStr)
Split a query string into a map and URL decode the values |
static String |
statusCodeToStr(int statusCode)
Convert an HTTP status code to a string |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final org.apache.commons.lang.time.FastDateFormat COOKIEDATEFORMAT
| Constructor Detail |
|---|
public HTTPUtils()
| Method Detail |
|---|
public static String assembleQueryStr(java.util.Map<String,String> queryMap)
queryMap - name value pairs
public static String formatDeleteCookie(String name,
String path,
String domain)
name - variable namepath - pathdomain - domain
public static String formatSetCookie(String name,
String value,
int timeoffset,
String path,
String domain,
boolean isSecure)
name - variable namevalue - variable value - null if no valuetimeoffset - expiration time in secondspath - cookie pathdomain - cookie domainisSecure - is cookie secure
public static byte[] HTTPRequestToByteArray(String inUrl,
String method,
String data,
java.util.Map<String,String> headers)
inUrl - url (will work with http and https)method - method (POST, GET)data - post dataheaders - map of headers (Content-type...)
public static byte[] HTTPRequestToByteArray(String inUrl,
String method,
String data,
java.util.Map<String,String> inHeaders,
java.util.Map<String,java.util.List<String>> outHeaders,
long dataLimit)
inUrl - url (will work with http and https)method - method (POST, GET)data - datainHeaders - map of headers (Content-type...)outHeaders - response headersdataLimit - maximum number of bytes to read, zero for no limit
public static boolean HTTPRequestToFile(java.io.File file,
String inUrl,
String method,
String data,
java.util.List headers)
file - destinationinUrl - url (will work with http and https)method - method (POST, GET)data - post dataheaders - map of headers (Content-type...)
public static java.util.List<String[]> splitCookie(String str)
str - input string
public static String[] splitPragmas(String str)
Split HTTP Pragma values at commas that separate values. It deals with internal commas in strings. Example:
no-cache, client-id=1485578017, features="seekable,stridable", timeout=6
Result:
no-cache
client-id=1485578017
features="seekable,stridable"
timeout=6
str - Pragma value
public static java.util.Map<String,String> splitQueryStr(String queryStr)
queryStr - query string
public static String statusCodeToStr(int statusCode)
statusCode - HTTP status code
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||