Class f_httpRequest

Object
  extended by f_object
      extended by f_httpRequest

public class f_httpRequest
extends f_object

HTTP request support.


Field Summary
static String ANY_MIME_TYPE
           
static String GET_METHOD
           
static String HTTP_CONTENT_TYPE
           
static String JAVASCRIPT_MIME_TYPE
           
static Number OK_STATUS
           
static String POST_METHOD
           
static String TEXT_HTML_MIME_TYPE
           
static String TEXT_PLAIN_MIME_TYPE
           
static String TEXT_XML_MIME_TYPE
           
 
Method Summary
 void f_cancelRequest()
          Cancel the request if possible.
 void f_doFormRequest(any data, String contentType, f_progressMonitor progressMonitor)
          Processeur de requête de type http form, les données sont passées sous forme d'un objet avec des propriétés
 void f_doRequest(String method, any data, String contentType, f_progressMonitor progressMonitor)
          Processeur de requête, les données par défaut seront les suivantes.
 boolean f_getReady()
          Returns ready state.
 String f_getResponse()
          Returns the raw data of the response.
 String f_getResponseContentType()
          Returns the response content type;
 String f_getResponseHeader(String name)
           
 Number f_getStatus()
          Returns the code associated to the status of the response.
 String f_getStatusText()
          Returns the message associated to the status of the response.
 Document f_getXmlResponse()
          Returns the reponse xml document.
 boolean f_isXmlResponse()
          Returns true if the response is a Xml document.
 void f_setAcceptType(String acceptType)
           
 void f_setListener(Object listener)
          Install a listener for asynchronus response processing.
 void f_setRequestHeader(String name, String value)
          Specifies a request header.
 
Methods inherited from class f_object
f_getClass, toString
 
Methods inherited from class Object
toString
 

Field Detail

HTTP_CONTENT_TYPE

public static final String HTTP_CONTENT_TYPE

ANY_MIME_TYPE

public static final String ANY_MIME_TYPE

GET_METHOD

public static final String GET_METHOD

TEXT_XML_MIME_TYPE

public static final String TEXT_XML_MIME_TYPE

TEXT_PLAIN_MIME_TYPE

public static final String TEXT_PLAIN_MIME_TYPE

OK_STATUS

public static final Number OK_STATUS

TEXT_HTML_MIME_TYPE

public static final String TEXT_HTML_MIME_TYPE

JAVASCRIPT_MIME_TYPE

public static final String JAVASCRIPT_MIME_TYPE

POST_METHOD

public static final String POST_METHOD
Method Detail

f_getStatusText

public String f_getStatusText()
Returns the message associated to the status of the response.


f_setRequestHeader

public void f_setRequestHeader(String name,
                               String value)
Specifies a request header.

Parameters:
name - Name of property.
value - Value to associate.

f_getResponseContentType

public String f_getResponseContentType()
Returns the response content type;


f_getReady

public boolean f_getReady()
Returns ready state.

Returns:
Ready state.

f_setListener

public void f_setListener(Object listener)
Install a listener for asynchronus response processing. Listener sample:
        var listener = {
                onInit: function(httpObject) {
                        alert("onInit");
                },
                onError: function(httpObject, status, text) {
                        alert("onError");
                },
                onProgress: function(httpObject, content, length, contentType) {
                        alert("onProgress");
                },
                onLoad: function(httpObject, content, contentType) {
                        alert("onLoad");
                },
                onAbort: function(httpObject, content, contentType) {
                        alert("onAbort");
                }
        }
 

Parameters:
listener - An object which defines callbacks for asynchronus processing.

f_getResponse

public String f_getResponse()
Returns the raw data of the response.


f_doFormRequest

public void f_doFormRequest(any data,
                            String contentType,
                            f_progressMonitor progressMonitor)
Processeur de requête de type http form, les données sont passées sous forme d'un objet avec des propriétés

Parameters:
data -
contentType -
progressMonitor -

f_doRequest

public void f_doRequest(String method,
                        any data,
                        String contentType,
                        f_progressMonitor progressMonitor)
Processeur de requête, les données par défaut seront les suivantes. la méthode est de type "POST", les données sont à NULL, le type mime est "text/plain" et le mode de transmission synchrone.

Parameters:
method -
data -
contentType -
progressMonitor -

f_getStatus

public Number f_getStatus()
Returns the code associated to the status of the response.


f_cancelRequest

public void f_cancelRequest()
Cancel the request if possible.


f_getXmlResponse

public Document f_getXmlResponse()
Returns the reponse xml document.


f_isXmlResponse

public boolean f_isXmlResponse()
Returns true if the response is a Xml document.


f_getResponseHeader

public String f_getResponseHeader(String name)
Parameters:
name -

f_setAcceptType

public void f_setAcceptType(String acceptType)
Parameters:
acceptType - Mime type of accept header parameter.