This article will focus on the MDS service reference for BlackBerry applications, including HTTP requests, HTTP request variables, and HTTP responses.
Application in BlackBerry development-MDS service reference
HTTP request [1]
A client establishes a connection and sends an HTTP request message to the server. The server then sends a response message, which usually contains the requested resources.
- <method><resource_path><version>
-
- Header1:value1
-
- Header2:value2
-
- Header3:value3
-
- <optionalmessage>
-
HTTP request variable
Description
Method
The method name specifies an action, such as GET, HEAD, or POST. The common method is GET, which requests a resource from the server.
Resource_path
The path to the requested resource. It is part of the URL and appears after the host name. It is also called the request URL (RequestURL ).
Version
The HTTP version you are running, marked as "HTTP/x. x". BES supports versions 1.0 and 1.1.
Header
Provides information about the requested or objects sent in the message body.
Optionalmessage
HTTP messages can contain data. in a request, it is a user-type data sent to the server, or an uploaded file. when an object is accompanied by this message, the request usually contains the message header that defines its attributes.
HTTP Response
Upon receiving an HTTP request message, the server sends a response message, which usually contains the requested resource.
- <HTTPversion><status_code><reason>
-
- Header1:value1
-
- Header2:value2
-
- Header3:value3
-
- <message>
-
HTTP Response Variable
Description
HTTP_version
The running HTTP Version marked as "HTTP/x. x". BES supports version 1.0 and Version 1.1.
Status_code
The value of the status code, which reflects the result of the request made by the client. For example, 200OK) indicates that the transmission is successful, and 404 NotFound) indicates that the request URL is not found.
Reason
Reason is a text message related to the status code.
Header
The message header provides response information and information about objects being sent in the message body.
Message
An HTTP message must contain data. In a response message, it provides the content requested by the client. This response also contains the message header that defines its attributes.
Note: The application should check the status code of the HTTP Response Message. Any status code that is not OK indicates that an error occurs when an HTTP connection is established.