public class Utils extends Object
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static HttpResponse |
requestLocalServer(String method,
String url,
Map<String,String> params)
Send a signed request to other internal applications.
|
static HttpResponse |
requestLocalServer(String method,
String url,
Map<String,String> params,
String contentType,
byte[] data)
Send a signed request to other internal applications.
|
static HttpResponse |
requestLocalServer(String method,
String url,
Map<String,String> params,
String contentType,
byte[] data,
String scheme,
String user)
Send a signed request to other internal applications.
|
static HttpResponse |
signAndSend(String prefix,
String signatureKey,
String method,
String host,
String path,
Map<String,String> params,
String contentType,
byte[] data,
String scheme)
Send a signed request.
|
public static HttpResponse signAndSend(String prefix, String signatureKey, String method, String host, String path, Map<String,String> params, String contentType, byte[] data, String scheme)
prefix - The prefix for the signature. This will be identified as
from() in the request.auth object of the receiversignatureKey - The header value in which the signature will be put in
the responsemethod - The HTTP methodpath - The URL pathhost - The host to send the request to. The host can verify the
signature only if this app's public key is present in it.params - Key-Value map of url parmeterscontentType - Type of the content to be sent with the requestdata - Data to be sent with the requestscheme - URL scheme like http, https, http+unix, etcpublic static HttpResponse requestLocalServer(String method, String url, Map<String,String> params, String contentType, byte[] data, String scheme, String user)
method - The HTTP methodurl - The URL pathparams - Key-Value map of url parmeterscontentType - Type of the content to be sent with the requestdata - Data to be sent with the requestscheme - URL scheme like http, https, http+unix, etcuser - The email id of the user on whose behalf this request is sent.public static HttpResponse requestLocalServer(String method, String url, Map<String,String> params, String contentType, byte[] data)
method - The HTTP methodurl - The URL pathparams - Key-Value map of url parmeterscontentType - Type of the content to be sent with the requestdata - Data to be sent with the requestpublic static HttpResponse requestLocalServer(String method, String url, Map<String,String> params)
method - The HTTP methodurl - The URL pathparams - Key-Value map of url parmetersCopyright © 2017. All rights reserved.