public final class RequestUtils extends Object
RequestBuilder.| Modifier and Type | Field and Description | 
|---|---|
static String | 
DEFAULT_ENDPOINT
Default end point for relative request. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
static String | 
encode(String content)
Encode a string into a valid URL string. 
 | 
static String | 
getUserAgent()
Gets the user agent. 
 | 
static boolean | 
isRelative(okhttp3.Request request)
Checks if is relative. 
 | 
static String | 
join(Iterable<?> iterable,
    String separator)
Creates a String of all elements of an iterable, separated by a separator. 
 | 
static <T> String | 
join(T[] array,
    String separator)
Creates a String of all elements of an array, separated by a separator. 
 | 
static Map<String,Object> | 
omit(Map<String,Object> params,
    String... toOmit)
Return a copy of a  
Map excluding the given key, or array of keys. | 
static Map<String,Object> | 
pick(Map<String,Object> params,
    String... toPick)
Return a copy of a  
Map with only the specified given key, or array of keys. | 
static String | 
replaceEndPoint(String url,
               String endPoint)
Replace the url end point (schema + host + port) with the given end point. 
 | 
public static final String DEFAULT_ENDPOINT
WatsonService with the real service end
 point.public static String encode(String content)
content - the contentpublic static boolean isRelative(okhttp3.Request request)
request - the okhttp3 requestpublic static Map<String,Object> omit(Map<String,Object> params, String... toOmit)
Map excluding the given key, or array of keys.params - the parameterstoOmit - the keys to omitpublic static Map<String,Object> pick(Map<String,Object> params, String... toPick)
Map with only the specified given key, or array of keys. If toPick is empty all
 keys will remain in the Map.params - the parameterstoPick - the keys to pickpublic static String replaceEndPoint(String url, String endPoint)
url - the url to updateendPoint - the end pointpublic static <T> String join(T[] array, String separator)
T - the generic typearray - the arrayseparator - the separatorpublic static String join(Iterable<?> iterable, String separator)
iterable - the iterableseparator - the separatorpublic static String getUserAgent()
Copyright © 2015–2016 IBM Watson. All rights reserved.