Reference to the MDS service for applications in BlackBerry development (1)

Source: Internet
Author: User

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.

 
 
  1. <method><resource_path><version> 
  2.  
  3. Header1:value1  
  4.  
  5. Header2:value2  
  6.  
  7. Header3:value3  
  8.  
  9. <optionalmessage> 
  10.  


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.

 
 
  1. <HTTPversion><status_code><reason> 
  2.  
  3. Header1:value1  
  4.  
  5. Header2:value2  
  6.  
  7. Header3:value3  
  8.  
  9. <message> 
  10.  


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.


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.