Package com.jalios.io
Class HttpClient
java.lang.Object
com.jalios.io.HttpClient
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected HttpURLConnectionprotected Stringstatic final Stringprotected intstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanInitialize a Connection to a given URLgetContents(String url) Connect, get the content and disconnect.Return the value of the cookie
-
Field Details
-
SET_COOKIE
- See Also:
-
JSESSSIONID
- See Also:
-
connection
-
cookie
-
responseCode
protected int responseCode
-
-
Constructor Details
-
HttpClient
public HttpClient()
-
-
Method Details
-
connect
Initialize a Connection to a given URL- Parameters:
url- the URL to connect- Returns:
- true if the connection is OK
-
getContents
Connect, get the content and disconnect.- Parameters:
url- the URL to request for the content- Returns:
- the content
-
readCookie
Return the value of the cookie- Returns:
- the cookie
- Throws:
IOException- Exception thrown on cookie reading
-