Package co.elastic.apm.agent.report
Class HttpUtils
- java.lang.Object
-
- co.elastic.apm.agent.report.HttpUtils
-
public class HttpUtils extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidconsumeAndClose(java.net.HttpURLConnection connection)In order to be able to reuse the underlying TCP connections, the input stream must be consumed and closed see also https://docs.oracle.com/javase/8/docs/technotes/guides/net/http-keepalive.htmlstatic java.lang.StringreadToString(java.io.InputStream inputStream)Reads the steam and converts the contents to a string, without closing stream.
-
-
-
Method Detail
-
readToString
public static java.lang.String readToString(java.io.InputStream inputStream) throws java.io.IOExceptionReads the steam and converts the contents to a string, without closing stream.- Parameters:
inputStream- the input stream- Returns:
- the content of the stream as a string
- Throws:
java.io.IOException
-
consumeAndClose
public static void consumeAndClose(@Nullable java.net.HttpURLConnection connection)In order to be able to reuse the underlying TCP connections, the input stream must be consumed and closed see also https://docs.oracle.com/javase/8/docs/technotes/guides/net/http-keepalive.html- Parameters:
connection- the connection
-
-