Springboot build HTTP service, return HTTP line is ' http/1.1 200 ' no Status Code description client parsing error

Source: Internet
Author: User

Data format for ————————————————————————————————————————— * * * Response  http/1.1 ok server:apache-coyote/1.1  accept-ranges:bytes etag:w/"27-1432777730225"  last-modified:thu, 01:48:50 GMT  Content-type:text/html content-length:27 date:thu, 07:03:37 gmt * HTTP/1.0 and http/1.1 difference * * Use The Telnet command, which operates each of these two versions of http***, uses http/1.0, and if a response is immediately disconnected * * * using http/1.1, a response is not immediately disconnected after the request of the   * HTTP protocol is made up of three parts:     ** the first part: Request line         ** request Line contains: Request method, request address, HTTP version      ** Part II: request header         ** similar to Key-value form, a key can correspond to a value, can also correspond to multiple value        ** three important request headers          *** Referer: An anti-theft chain that gets the address of the current request          **** Create two folders my    and other        **** create two pages respectively MY.HTML  OTHER.HTML&Nbsp;       ***** can only be accessed by files within my folder          ***** only files within the My folder can be accessed servlet         *** User-agent: Gets the information of the currently requested browser          *** If-modified-since: Often used in conjunction with the response inside last-modified for querying the local cache      ** Part III: Request Body          ** data submitted via post user=lisi     ** forms are submitted in many ways, with two commonly used get and post      ** accept:text/html,image/*                                           ,         &NB Sp       Client identification file types       Accept-Charset:ISO-8859-1                               ,         &NB Sp &nbSp                   Client Character Set     Accept-Encoding:gzip                           ,         &NB Sp                                 Client Support encoding type Gzip compression format     Accept-Language:zh-cn                  & nbsp                          ,         &NB Sp             Client language     Host:www.itcast.com:80                               ,         &NB Sp                           Access server address     i F-modified-sincE:tue, Jul 18:23:51 gmt                          (important) Use control cache with last-modified     Referer:http://www.itcast.com/index.jsp                                   /    (important ) Prevent hotlinking     user-agent:mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)     Browser type (file download, different browser for different processing)     Connection:close/Keep-Alive                           ,         &NB Sp                       After request the connection is closed or remains     date:tue 18:23:51 gmt                          &NBSP ;                     Request time  &NThe response of the bsp;* HTTP protocol is composed of three parts:     ** First part: Response line         ** Structure: HTTP version, status code, status code description         ** status code: Status of the current response           *** Common Status Codes                  * 200: Success ok                 * 302: Redirect                  * 304: Find local cache                  * 404: Resources not found                  * 500: Server Internal error (code is wrong)                  * 503: Server hung up      ** Part II: Response header          ** similar to KEY value form, a key can have one or more value        *** three important response header information          * location             ** frequently and 3,021 implementations of redirected             * code              //redirect using status code 302             response.setstatus (302);             //Setting header information location to complete the redirect Operation              response.setheader ("Location", "/day07/my/my.html");          * refresh            ** A timed jump on the page             ** Code           &nbSp;  response.getwriter (). Write ("The page will jump after 3 seconds.");             //use Refresh header information to achieve timed jump              response.setheader ("Refresh", "3;url=/day07/other/ Other.html ");          * last-modified:             ** often request inside if-modified-since together use Find local cache           * content-disposition: Do File download time         *** Disable browser caching         * Expires: -1         Cache-Control:no-cache          Pragma:no-cache         ** Part III: Response Body         ** Display content on the page      ** redirect and forward differences     *** In a request, and made a request     ** redirect: For example, find a small article to borrow money 100,000, Xiaowen no money, tell me little warm money, I went to find a little warm, the money to     *** Request two times, response two times      ** forwarding: For example, find Zhang San borrow money, but Zhang San no money, Zhang San to help me find John Doe borrow money, finally give me     *** request, Respond once   ——————————————————————————————————————————————————————————————————————        springboot build HTTP service, return the HTTP line is ' http/1.1 200 ' instead of ' http/1.1 OK '    from Springboot 1.4.0 or later this issue   The version of Tomcat, to be exact, was upgraded. OK in the http/1.1 protocol is enclosed in parentheses. That is, there can be no. The client should be compatible with this way to reduce the Springbot built-in tomcat version number  1, parse Spring boot parent dependency  
<parent> <groupId>org.springframework.boot</groupId> <artifactId> Spring-boot-starter-parent</artifactid> <version>1.5.6.RELEASE</version></parent>
This configuration is spring boot parent dependency, with this, the current project is the Spring boot project, Spring-boot-starter-parent is a special starter, it is used to provide the relevant MAVEN default dependency, after using it , the usual package dependencies can be omitted from the version label. For information about which jar packages the spring boot provides, you can view the C:\Users\ user. m2\repository\org\springframework\boot\spring-boot-dependencies\1.5.1. Release\spring-boot-dependencies-1.5.1.release.pom 2, open this pom file, search "Tomcat.version" will find:<tomcat.version> 8.5.16</tomcat.version>① can directly modify the version of the Tomcat you want here ② in the Pom of your own project to add the version, you can directly overwrite the release here.  Example: Tomcat version configuration code for POM?<properties> <tomcat.version>8.0.29</tomcat.version></properties> After adding this, Spingboot's default boot version of Tomcat will do what you need.  It's basically done here. But sometimes the boot will error: Tomcat boot error code
caused by:java.lang.noclassdeffounderror:org/apache/juli/logging/logfactory  at Org.apache.catalina.util.LifecycleBase. <clinit> (lifecyclebase.java:37)  at Org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getEmbeddedServletContainer (Tomcatembeddedservletcontainerfactory.java:169)  at Org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer ( Embeddedwebapplicationcontext.java:164)  at Org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh ( Embeddedwebapplicationcontext.java:134)  Common frames omitted
Because the tocmat of this time is missing the jar, the MAVEN project adds the following dependency: Android Invoke method the underlying return null C + + direct NULL pointer

Springboot build HTTP service, return HTTP line is ' http/1.1 200 ' no Status Code description client parsing error

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.