Qt Jambi Home

com.trolltech.qt.network
Class QHttpRequestHeader

java.lang.Object
  extended by com.trolltech.qt.QSignalEmitter
      extended by com.trolltech.qt.QtJambiObject
          extended by com.trolltech.qt.network.QHttpHeader
              extended by com.trolltech.qt.network.QHttpRequestHeader
All Implemented Interfaces:
QtJambiInterface

public class QHttpRequestHeader
extends QHttpHeader

The QHttpRequestHeader class contains request header information for HTTP.

This class is used in the QHttp class to report the header information if the client requests something from the server.

HTTP requests have a method which describes the request's action. The most common requests are "GET" and "POST". In addition to the request method the header also includes a request-URI to specify the location for the method to use.

The method, request-URI and protocol-version can be set using a constructor or later using setRequest. The values can be obtained using method, path, majorVersion and minorVersion.

Important inherited functions: setValue and value.

See Also:
QHttpResponseHeader, QHttp

Nested Class Summary
 
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter
QSignalEmitter.Signal0, QSignalEmitter.Signal1<A>, QSignalEmitter.Signal2<A,B>, QSignalEmitter.Signal3<A,B,C>, QSignalEmitter.Signal4<A,B,C,D>, QSignalEmitter.Signal5<A,B,C,D,E>, QSignalEmitter.Signal6<A,B,C,D,E,F>, QSignalEmitter.Signal7<A,B,C,D,E,F,G>, QSignalEmitter.Signal8<A,B,C,D,E,F,G,H>, QSignalEmitter.Signal9<A,B,C,D,E,F,G,H,I>
 
Constructor Summary
QHttpRequestHeader()
          Constructs an empty HTTP request header.
QHttpRequestHeader(QHttpRequestHeader header)
          Constructs a copy of header.
QHttpRequestHeader(java.lang.String str)
          Constructs a HTTP request header from the string str.
QHttpRequestHeader(java.lang.String method, java.lang.String path)
          Equivalent to QHttpRequestHeader(method, path, 1, 1).
QHttpRequestHeader(java.lang.String method, java.lang.String path, int majorVer)
          Equivalent to QHttpRequestHeader(method, path, majorVer, 1).
QHttpRequestHeader(java.lang.String method, java.lang.String path, int majorVer, int minorVer)
          Constructs a HTTP request header for the method method, the request-URI path and the protocol-version majorVer and minorVer.
 
Method Summary
static QHttpRequestHeader fromNativePointer(QNativePointer nativePointer)
          This function returns the QHttpRequestHeader instance pointed to by nativePointer
 int majorVersion()
          Returns the major protocol-version of the HTTP request header.
 java.lang.String method()
          Returns the method of the HTTP request header.
 int minorVersion()
          Returns the minor protocol-version of the HTTP request header.
static QNativePointer nativePointerArray(QHttpRequestHeader[] array)
          This function returns a QNativePointer that is pointing to the specified QHttpRequestHeader array.
protected  boolean parseLine(java.lang.String line, int number)
          

 java.lang.String path()
          Returns the request-URI of the HTTP request header.
 void setRequest(java.lang.String method, java.lang.String path)
          Equivalent to setRequest(method, path, 1, 1).
 void setRequest(java.lang.String method, java.lang.String path, int majorVer)
          Equivalent to setRequest(method, path, majorVer, 1).
 void setRequest(java.lang.String method, java.lang.String path, int majorVer, int minorVer)
          This function sets the request method to method, the request-URI to path and the protocol-version to majorVer and minorVer.
 java.lang.String toString()
          

Returns a string representation of the HTTP header.

 
Methods inherited from class com.trolltech.qt.network.QHttpHeader
addValue, allValues, contentLength, contentType, hasContentLength, hasContentType, hasKey, isValid, keys, parse, removeAllValues, removeValue, setContentLength, setContentType, setValid, setValue, setValues, value, values
 
Methods inherited from class com.trolltech.qt.QtJambiObject
dispose, disposed, finalize, reassignNativeResources, tr, tr, tr
 
Methods inherited from class com.trolltech.qt.QSignalEmitter
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.trolltech.qt.QtJambiInterface
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership
 

Constructor Detail

QHttpRequestHeader

public QHttpRequestHeader(java.lang.String method,
                          java.lang.String path,
                          int majorVer)

Equivalent to QHttpRequestHeader(method, path, majorVer, 1).


QHttpRequestHeader

public QHttpRequestHeader(java.lang.String method,
                          java.lang.String path)

Equivalent to QHttpRequestHeader(method, path, 1, 1).


QHttpRequestHeader

public QHttpRequestHeader(java.lang.String method,
                          java.lang.String path,
                          int majorVer,
                          int minorVer)

Constructs a HTTP request header for the method method, the request-URI path and the protocol-version majorVer and minorVer.


QHttpRequestHeader

public QHttpRequestHeader(java.lang.String str)

Constructs a HTTP request header from the string str. The str should consist of one or more "\r\n" delimited lines; the first line should be the request-line (format: method, space, request-URI, space HTTP-version); each of the remaining lines should have the format key, colon, space, value.


QHttpRequestHeader

public QHttpRequestHeader()

Constructs an empty HTTP request header.


QHttpRequestHeader

public QHttpRequestHeader(QHttpRequestHeader header)

Constructs a copy of header.

Method Detail

method

public final java.lang.String method()

Returns the method of the HTTP request header.

See Also:
path, majorVersion, minorVersion, setRequest

path

public final java.lang.String path()

Returns the request-URI of the HTTP request header.

See Also:
method, majorVersion, minorVersion, setRequest

setRequest

public final void setRequest(java.lang.String method,
                             java.lang.String path,
                             int majorVer)

Equivalent to setRequest(method, path, majorVer, 1).


setRequest

public final void setRequest(java.lang.String method,
                             java.lang.String path)

Equivalent to setRequest(method, path, 1, 1).


setRequest

public final void setRequest(java.lang.String method,
                             java.lang.String path,
                             int majorVer,
                             int minorVer)

This function sets the request method to method, the request-URI to path and the protocol-version to majorVer and minorVer.

See Also:
method, path, majorVersion, minorVersion

majorVersion

public int majorVersion()

Returns the major protocol-version of the HTTP request header.

Specified by:
majorVersion in class QHttpHeader
See Also:
minorVersion, method, path, setRequest

minorVersion

public int minorVersion()

Returns the minor protocol-version of the HTTP request header.

Specified by:
minorVersion in class QHttpHeader
See Also:
majorVersion, method, path, setRequest

parseLine

protected boolean parseLine(java.lang.String line,
                            int number)

Overrides:
parseLine in class QHttpHeader
See Also:
parse

toString

public java.lang.String toString()

Returns a string representation of the HTTP header.

The string is suitable for use by the constructor that takes a QString. It consists of lines with the format: key, colon, space, value, "\r\n".

Overrides:
toString in class QHttpHeader

fromNativePointer

public static QHttpRequestHeader fromNativePointer(QNativePointer nativePointer)
This function returns the QHttpRequestHeader instance pointed to by nativePointer

Parameters:
nativePointer - the QNativePointer of which object should be returned.

nativePointerArray

public static QNativePointer nativePointerArray(QHttpRequestHeader[] array)
This function returns a QNativePointer that is pointing to the specified QHttpRequestHeader array.

Parameters:
array - the array that the returned pointer will point to.
Returns:
a QNativePointer that is pointing to the specified array.

Qt Jambi Home