net.rim.device.api.io.messaging
Interface HttpMessage


public interface HttpMessage

A specialized implementation of Message used by HTTP Destinations. Additional HTTP specific concepts, such as method and response codes, are supported by this Message.

Since:
BlackBerry API 6.0.0

Field Summary
static String DELETE
          The HTTP method constant for DELETE request
static String GET
          The HTTP method constant for GET request
static String HEAD
          The HTTP method constant for HEAD request
static String POST
          The HTTP method constant for POST request
static String PUT
          The HTTP method constant for PUT request
 
Method Summary
 String getMethod()
          Returns the HTTP method used with this message.
 String getQueryParamString()
          Returns the query parameter string (as it appears after the "?"
 int getResponseCode()
          Returns the HTTP response code.
 void setMethod(String method)
          Sets the HTTP method used when sending this message.
 void setQueryParam(String key, String value)
          Sets an individual query parameter.
 void setQueryParam(String key, String[] value)
          Sets an HTTP query parameter with the values used by this message.
 



Field Detail

HEAD

static final String HEAD
The HTTP method constant for HEAD request

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

GET

static final String GET
The HTTP method constant for GET request

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

PUT

static final String PUT
The HTTP method constant for PUT request

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

POST

static final String POST
The HTTP method constant for POST request

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

DELETE

static final String DELETE
The HTTP method constant for DELETE request

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0


Method Detail

setMethod

void setMethod(String method)
Sets the HTTP method used when sending this message. If the Destination for this message uses a transport other than HTTP, then this parameter will be ignored.

Parameters:
method - The HTTP method constant identifying which HTTP method should be used.
Since:
BlackBerry API 6.0.0

getMethod

String getMethod()
Returns the HTTP method used with this message.

Returns:
A string representing the HTTP method: GET, PUT, POST, or DELETE.
Since:
BlackBerry API 6.0.0

getResponseCode

int getResponseCode()
Returns the HTTP response code.

Returns:
HTTP response code for this message.
Since:
BlackBerry API 6.0.0

setQueryParam

void setQueryParam(String key,
                   String[] value)
Sets an HTTP query parameter with the values used by this message. If a query parameter with this key already exists, it will be replaced.

Parameters:
key - Key for the query parameter
value - Values for the query parameter. Values will be placed in the query string in the order they appear in the Array.
Since:
BlackBerry API 6.0.0

setQueryParam

void setQueryParam(String key,
                   String value)
Sets an individual query parameter. If a query parameter already exists for this key, it will be replaced.

Parameters:
key - Key for the query parameter.
value - Value for the query parameter.
Since:
BlackBerry API 6.0.0

getQueryParamString

String getQueryParamString()
Returns the query parameter string (as it appears after the "?" in the URI).

Returns:
The query parameter string.
Since:
BlackBerry API 6.0.0





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal