org.jboss.errai.tools.proxy
Class HttpClient
java.lang.Object
org.jboss.errai.tools.proxy.HttpClient
public class HttpClient
- extends Object
- Author:
- Yutaka Yoshida, Greg Murray, Heiko Braun
Minimum set of HTTPclient supporting both http and https.
It's aslo capable of POST, but it doesn't provide doGet because
the caller can just read the inputstream.
Constructor Summary |
HttpClient(String phost,
int pport,
String url,
Map headers,
String method,
String userName,
String password,
XmlHttpProxy.CookieCallback callback)
|
HttpClient(String phost,
int pport,
String url,
Map headers,
String method,
XmlHttpProxy.CookieCallback callback)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HttpClient
public HttpClient(String phost,
int pport,
String url,
Map headers,
String method,
XmlHttpProxy.CookieCallback callback)
throws MalformedURLException
- Parameters:
phost
- PROXY host namepport
- PROXY port stringurl
- URL stringheaders
- Map
- Throws:
MalformedURLException
HttpClient
public HttpClient(String phost,
int pport,
String url,
Map headers,
String method,
String userName,
String password,
XmlHttpProxy.CookieCallback callback)
throws MalformedURLException
- Parameters:
phost
- PROXY host namepport
- PROXY port stringurl
- URL stringheaders
- MapuserName
- stringpassword
- string
- Throws:
MalformedURLException
getSetCookieHeader
public String getSetCookieHeader()
getInputStream
public InputStream getInputStream()
- returns the inputstream from URLConnection
- Returns:
- InputStream
getOutputStream
public OutputStream getOutputStream()
- return the OutputStream from URLConnection
- Returns:
- OutputStream
doPost
public InputStream doPost(String postData,
String contentType)
- posts data to the inputstream and returns the InputStream.
- Parameters:
postData
- data to be posted. must be url-encoded already.contentType
- allows you to set the contentType of the request.
- Returns:
- InputStream input stream from URLConnection
getContentEncoding
public String getContentEncoding()
getContentLength
public int getContentLength()
getContentType
public String getContentType()
getDate
public long getDate()
getHeader
public String getHeader(String name)
getIfModifiedSince
public long getIfModifiedSince()
getLogger
public static Logger getLogger()
Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.