Package org.cybergarage.http
Class HTTPRequest
- java.lang.Object
-
- org.cybergarage.http.HTTPPacket
-
- org.cybergarage.http.HTTPRequest
-
- Direct Known Subclasses:
SOAPRequest
,SSDPRequest
,SubscriptionRequest
public class HTTPRequest extends HTTPPacket
This class rappresnet an HTTP request, and act as HTTP client when it sends the request- Version:
- 1.8
- Author:
- Satoshi "skonno" Konno, Stefano "Kismet" Lenzi
-
-
Constructor Summary
Constructors Constructor Description HTTPRequest()
HTTPRequest(InputStream in)
HTTPRequest(HTTPSocket httpSock)
-
Method Summary
-
Methods inherited from class org.cybergarage.http.HTTPPacket
addHeader, addHeader, clearHeaders, getCacheControl, getCharSet, getConnection, getContent, getContentInputStream, getContentLanguage, getContentLength, getContentRange, getContentRangeFirstPosition, getContentRangeInstanceLength, getContentRangeLastPosition, getContentString, getContentType, getDate, getFirstLine, getFirstLineToken, getHeader, getHeader, getHeaderString, getHeaderValue, getHost, getIntegerHeaderValue, getLongHeaderValue, getNHeaders, getServer, getStringHeaderValue, getStringHeaderValue, getTransferEncoding, getVersion, hasConnection, hasContent, hasContentInputStream, hasContentRange, hasFirstLine, hasHeader, hasTransferEncoding, init, isChunked, isCloseConnection, isKeepAliveConnection, read, set, set, set, set, setCacheControl, setCacheControl, setCacheControl, setConnection, setContent, setContent, setContent, setContent, setContentInputStream, setContentLanguage, setContentLength, setContentRange, setContentType, setDate, setHeader, setHeader, setHeader, setHeader, setHost, setHost, setIntegerHeader, setLongHeader, setServer, setStringHeader, setStringHeader, setTransferEncoding, setVersion
-
-
-
-
Constructor Detail
-
HTTPRequest
public HTTPRequest()
-
HTTPRequest
public HTTPRequest(InputStream in)
-
HTTPRequest
public HTTPRequest(HTTPSocket httpSock)
-
-
Method Detail
-
setMethod
public void setMethod(String value)
-
getMethod
public String getMethod()
-
isMethod
public boolean isMethod(String method)
-
isGetRequest
public boolean isGetRequest()
-
isPostRequest
public boolean isPostRequest()
-
isHeadRequest
public boolean isHeadRequest()
-
isSubscribeRequest
public boolean isSubscribeRequest()
-
isUnsubscribeRequest
public boolean isUnsubscribeRequest()
-
isNotifyRequest
public boolean isNotifyRequest()
-
setURI
public void setURI(String value, boolean isCheckRelativeURL)
-
setURI
public void setURI(String value)
-
getURI
public String getURI()
-
getParameterList
public ParameterList getParameterList()
-
isSOAPAction
public boolean isSOAPAction()
-
setRequestHost
public void setRequestHost(String host)
-
getRequestHost
public String getRequestHost()
-
setRequestPort
public void setRequestPort(int host)
-
getRequestPort
public int getRequestPort()
-
setSocket
public void setSocket(HTTPSocket value)
-
getSocket
public HTTPSocket getSocket()
-
getLocalAddress
public String getLocalAddress()
-
getLocalPort
public int getLocalPort()
-
parseRequestLine
public boolean parseRequestLine(String lineStr)
-
getHTTPVersion
public String getHTTPVersion()
-
getFirstLineString
public String getFirstLineString()
-
getHeader
public String getHeader()
-
isKeepAlive
public boolean isKeepAlive()
-
read
public boolean read()
-
post
public boolean post(HTTPResponse httpRes)
-
setBindHost
public void setBindHost(String host)
I2P - bind HTTP socket to specified local host address- Parameters:
host
- null to not bind to a particlar local address- Since:
- 0.9.50
-
post
public HTTPResponse post(String host, int port, boolean isKeepAlive)
-
post
public HTTPResponse post(String host, int port)
-
set
public void set(HTTPRequest httpReq)
-
returnResponse
public boolean returnResponse(int statusCode)
-
returnOK
public boolean returnOK()
-
returnBadRequest
public boolean returnBadRequest()
-
print
public void print()
-
-