[httpcomments-client-4.5.2]--Source Analysis (HTTP response)

Source: Internet
Author: User
Tags numeric

The HTTP response is a message sent by the server back to the client and the have received and interpreted a request message. The "a" of this message consists of the protocol version followed by a numeric status code and its associated textu Al phrase.
An HTTP response is an explanation of the response message sent back to the client after the server receives the request message. The first line of the message includes the protocol version, followed by the numeric status code and its associated text phrase.

HttpResponse response = new Basichttpresponse (httpversion.http_1_1, 
httpstatus.sc_ok, "OK");

System.out.println (Response.getprotocolversion ());
System.out.println (Response.getstatusline (). Getstatuscode ());
System.out.println (Response.getstatusline (). Getreasonphrase ());
System.out.println (Response.getstatusline (). toString ());

StdOut >

http/1.1
http/1.1 OK

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.