Package org.logevents.util
Class NetUtils
- java.lang.Object
-
- org.logevents.util.NetUtils
-
public class NetUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description NetUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static HttpURLConnection
post(URL url, String contentBody, String contentType)
static HttpURLConnection
post(URL url, String contentBody, String contentType, Proxy proxy)
static Map<String,Object>
postFormForJson(URL url, Map<String,String> formPayload)
static String
postJson(URL url, String json, Proxy proxy)
static String
readAsString(InputStream inputStream)
-
-
-
Method Detail
-
post
public static HttpURLConnection post(URL url, String contentBody, String contentType) throws IOException
- Throws:
IOException
-
post
public static HttpURLConnection post(URL url, String contentBody, String contentType, Proxy proxy) throws IOException
- Throws:
IOException
-
postJson
public static String postJson(URL url, String json, Proxy proxy) throws IOException
- Throws:
IOException
-
postFormForJson
public static Map<String,Object> postFormForJson(URL url, Map<String,String> formPayload) throws IOException
- Throws:
IOException
-
readAsString
public static String readAsString(InputStream inputStream) throws IOException
- Throws:
IOException
-
-