cybergarage-upnp
org.cybergarage.http.HTTPRequest Class Reference
Inheritance diagram for org.cybergarage.http.HTTPRequest:
org.cybergarage.http.HTTPPacket org.cybergarage.soap.SOAPRequest org.cybergarage.upnp.event.SubscriptionRequest org.cybergarage.upnp.ssdp.SSDPRequest org.cybergarage.upnp.control.ControlRequest org.cybergarage.upnp.event.NotifyRequest org.cybergarage.upnp.ssdp.SSDPNotifyRequest org.cybergarage.upnp.ssdp.SSDPSearchRequest org.cybergarage.upnp.control.ActionRequest org.cybergarage.upnp.control.QueryRequest

Public Member Functions

 HTTPRequest ()
 
 HTTPRequest (InputStream in)
 
 HTTPRequest (HTTPSocket httpSock)
 
void setMethod (String value)
 
String getMethod ()
 
boolean isMethod (String method)
 
boolean isGetRequest ()
 
boolean isPostRequest ()
 
boolean isHeadRequest ()
 
boolean isSubscribeRequest ()
 
boolean isUnsubscribeRequest ()
 
boolean isNotifyRequest ()
 
void setURI (String value, boolean isCheckRelativeURL)
 
void setURI (String value)
 
String getURI ()
 
ParameterList getParameterList ()
 
String getParameterValue (String name)
 
boolean isSOAPAction ()
 
void setRequestHost (String host)
 
String getRequestHost ()
 
void setRequestPort (int host)
 
int getRequestPort ()
 
void setSocket (HTTPSocket value)
 
HTTPSocket getSocket ()
 
String getLocalAddress ()
 
int getLocalPort ()
 
boolean parseRequestLine (String lineStr)
 
String getHTTPVersion ()
 
String getFirstLineString ()
 
String getHeader ()
 
boolean isKeepAlive ()
 
boolean read ()
 
boolean post (HTTPResponse httpRes)
 
HTTPResponse post (String host, int port, boolean isKeepAlive)
 
HTTPResponse post (String host, int port)
 
void set (HTTPRequest httpReq)
 
boolean returnResponse (int statusCode)
 
boolean returnOK ()
 
boolean returnBadRequest ()
 
String toString ()
 
void print ()
 
- Public Member Functions inherited from org.cybergarage.http.HTTPPacket
 HTTPPacket ()
 
 HTTPPacket (HTTPPacket httpPacket)
 
 HTTPPacket (InputStream in)
 
void init ()
 
void setVersion (String ver)
 
String getVersion ()
 
boolean read (HTTPSocket httpSock)
 
boolean hasFirstLine ()
 
int getNHeaders ()
 
void addHeader (HTTPHeader header)
 
void addHeader (String name, String value)
 
HTTPHeader getHeader (int n)
 
HTTPHeader getHeader (String name)
 
void clearHeaders ()
 
boolean hasHeader (String name)
 
void setHeader (String name, String value)
 
void setHeader (String name, int value)
 
void setHeader (String name, long value)
 
void setHeader (HTTPHeader header)
 
String getHeaderValue (String name)
 
void setStringHeader (String name, String value, String startWidth, String endWidth)
 
void setStringHeader (String name, String value)
 
String getStringHeaderValue (String name, String startWidth, String endWidth)
 
String getStringHeaderValue (String name)
 
void setIntegerHeader (String name, int value)
 
void setLongHeader (String name, long value)
 
int getIntegerHeaderValue (String name)
 
long getLongHeaderValue (String name)
 
String getHeaderString ()
 
void setContent (byte data[], boolean updateWithContentLength)
 
void setContent (byte data[])
 
void setContent (String data, boolean updateWithContentLength)
 
void setContent (String data)
 
byte[] getContent ()
 
String getContentString ()
 
boolean hasContent ()
 
void setContentInputStream (InputStream in)
 
InputStream getContentInputStream ()
 
boolean hasContentInputStream ()
 
void setContentType (String type)
 
String getContentType ()
 
void setContentLanguage (String code)
 
String getContentLanguage ()
 
String getCharSet ()
 
void setContentLength (long len)
 
long getContentLength ()
 
boolean hasConnection ()
 
void setConnection (String value)
 
String getConnection ()
 
boolean isCloseConnection ()
 
boolean isKeepAliveConnection ()
 
boolean hasContentRange ()
 
void setContentRange (long firstPos, long lastPos, long length)
 
long[] getContentRange ()
 
long getContentRangeFirstPosition ()
 
long getContentRangeLastPosition ()
 
long getContentRangeInstanceLength ()
 
void setCacheControl (String directive)
 
void setCacheControl (String directive, int value)
 
void setCacheControl (int value)
 
String getCacheControl ()
 
void setServer (String name)
 
String getServer ()
 
void setHost (String host, int port)
 
void setHost (String host)
 
String getHost ()
 
void setDate (Calendar cal)
 
String getDate ()
 
boolean hasTransferEncoding ()
 
void setTransferEncoding (String value)
 
String getTransferEncoding ()
 
boolean isChunked ()
 

Private Attributes

String method = null
 
String uri = null
 
String requestHost = ""
 
int requestPort = -1
 
HTTPSocket httpSocket = null
 
Socket postSocket = null
 

Additional Inherited Members

- Protected Member Functions inherited from org.cybergarage.http.HTTPPacket
boolean set (InputStream in, boolean onlyHeaders)
 
boolean set (InputStream in)
 
boolean set (HTTPSocket httpSock)
 
void set (HTTPPacket httpPacket)
 
String getFirstLine ()
 
String getFirstLineToken (int num)
 

Detailed Description

This class rappresnet an HTTP request, and act as HTTP client when it sends the request

Author
Satoshi "skonno" Konno
Stefano "Kismet" Lenzi
Version
1.8

Constructor & Destructor Documentation

◆ HTTPRequest() [1/3]

org.cybergarage.http.HTTPRequest.HTTPRequest ( )
inline

◆ HTTPRequest() [2/3]

org.cybergarage.http.HTTPRequest.HTTPRequest ( InputStream in)
inline

◆ HTTPRequest() [3/3]

org.cybergarage.http.HTTPRequest.HTTPRequest ( HTTPSocket httpSock)
inline

Member Function Documentation

◆ getFirstLineString()

String org.cybergarage.http.HTTPRequest.getFirstLineString ( )
inline

◆ getHeader()

String org.cybergarage.http.HTTPRequest.getHeader ( )
inline

◆ getHTTPVersion()

String org.cybergarage.http.HTTPRequest.getHTTPVersion ( )
inline

◆ getLocalAddress()

String org.cybergarage.http.HTTPRequest.getLocalAddress ( )
inline

◆ getLocalPort()

int org.cybergarage.http.HTTPRequest.getLocalPort ( )
inline

◆ getMethod()

String org.cybergarage.http.HTTPRequest.getMethod ( )
inline

◆ getParameterList()

ParameterList org.cybergarage.http.HTTPRequest.getParameterList ( )
inline

◆ getParameterValue()

String org.cybergarage.http.HTTPRequest.getParameterValue ( String name)
inline

◆ getRequestHost()

String org.cybergarage.http.HTTPRequest.getRequestHost ( )
inline

◆ getRequestPort()

int org.cybergarage.http.HTTPRequest.getRequestPort ( )
inline

◆ getSocket()

HTTPSocket org.cybergarage.http.HTTPRequest.getSocket ( )
inline

◆ getURI()

String org.cybergarage.http.HTTPRequest.getURI ( )
inline

◆ isGetRequest()

boolean org.cybergarage.http.HTTPRequest.isGetRequest ( )
inline

◆ isHeadRequest()

boolean org.cybergarage.http.HTTPRequest.isHeadRequest ( )
inline

◆ isKeepAlive()

boolean org.cybergarage.http.HTTPRequest.isKeepAlive ( )
inline

◆ isMethod()

boolean org.cybergarage.http.HTTPRequest.isMethod ( String method)
inline

◆ isNotifyRequest()

boolean org.cybergarage.http.HTTPRequest.isNotifyRequest ( )
inline

◆ isPostRequest()

boolean org.cybergarage.http.HTTPRequest.isPostRequest ( )
inline

◆ isSOAPAction()

boolean org.cybergarage.http.HTTPRequest.isSOAPAction ( )
inline

◆ isSubscribeRequest()

boolean org.cybergarage.http.HTTPRequest.isSubscribeRequest ( )
inline

◆ isUnsubscribeRequest()

boolean org.cybergarage.http.HTTPRequest.isUnsubscribeRequest ( )
inline

◆ parseRequestLine()

boolean org.cybergarage.http.HTTPRequest.parseRequestLine ( String lineStr)
inline

◆ post() [1/3]

boolean org.cybergarage.http.HTTPRequest.post ( HTTPResponse httpRes)
inline

◆ post() [2/3]

HTTPResponse org.cybergarage.http.HTTPRequest.post ( String host,
int port )
inline

◆ post() [3/3]

HTTPResponse org.cybergarage.http.HTTPRequest.post ( String host,
int port,
boolean isKeepAlive )
inline

◆ print()

void org.cybergarage.http.HTTPRequest.print ( )
inline

◆ read()

boolean org.cybergarage.http.HTTPRequest.read ( )
inline

◆ returnBadRequest()

boolean org.cybergarage.http.HTTPRequest.returnBadRequest ( )
inline

◆ returnOK()

boolean org.cybergarage.http.HTTPRequest.returnOK ( )
inline

◆ returnResponse()

boolean org.cybergarage.http.HTTPRequest.returnResponse ( int statusCode)
inline

◆ set()

void org.cybergarage.http.HTTPRequest.set ( HTTPRequest httpReq)
inline

◆ setMethod()

void org.cybergarage.http.HTTPRequest.setMethod ( String value)
inline

◆ setRequestHost()

void org.cybergarage.http.HTTPRequest.setRequestHost ( String host)
inline

◆ setRequestPort()

void org.cybergarage.http.HTTPRequest.setRequestPort ( int host)
inline

◆ setSocket()

void org.cybergarage.http.HTTPRequest.setSocket ( HTTPSocket value)
inline

◆ setURI() [1/2]

void org.cybergarage.http.HTTPRequest.setURI ( String value)
inline

◆ setURI() [2/2]

void org.cybergarage.http.HTTPRequest.setURI ( String value,
boolean isCheckRelativeURL )
inline

◆ toString()

String org.cybergarage.http.HTTPRequest.toString ( )
inline

Field Documentation

◆ httpSocket

HTTPSocket org.cybergarage.http.HTTPRequest.httpSocket = null
private

◆ method

String org.cybergarage.http.HTTPRequest.method = null
private

◆ postSocket

Socket org.cybergarage.http.HTTPRequest.postSocket = null
private

◆ requestHost

String org.cybergarage.http.HTTPRequest.requestHost = ""
private

◆ requestPort

int org.cybergarage.http.HTTPRequest.requestPort = -1
private

◆ uri

String org.cybergarage.http.HTTPRequest.uri = null
private

The documentation for this class was generated from the following file: