<i id='D7szh'><tr id='D7szh'><dt id='D7szh'><q id='D7szh'><span id='D7szh'><b id='D7szh'><form id='D7szh'><ins id='D7szh'></ins><ul id='D7szh'></ul><sub id='D7szh'></sub></form><legend id='D7szh'></legend><bdo id='D7szh'><pre id='D7szh'><center id='D7szh'></center></pre></bdo></b><th id='D7szh'></th></span></q></dt></tr></i><div id='D7szh'><tfoot id='D7szh'></tfoot><dl id='D7szh'><fieldset id='D7szh'></fieldset></dl></div>
  • <small id='D7szh'></small><noframes id='D7szh'>

  • <tfoot id='D7szh'></tfoot>
    <legend id='D7szh'><style id='D7szh'><dir id='D7szh'><q id='D7szh'></q></dir></style></legend>

      <bdo id='D7szh'></bdo><ul id='D7szh'></ul>

      1. 解析原始 HTTP 请求

        Parsing raw HTTP Request(解析原始 HTTP 请求)

            <bdo id='rPHj8'></bdo><ul id='rPHj8'></ul>
          • <legend id='rPHj8'><style id='rPHj8'><dir id='rPHj8'><q id='rPHj8'></q></dir></style></legend>
            1. <tfoot id='rPHj8'></tfoot>
                <tbody id='rPHj8'></tbody>

              <small id='rPHj8'></small><noframes id='rPHj8'>

                • <i id='rPHj8'><tr id='rPHj8'><dt id='rPHj8'><q id='rPHj8'><span id='rPHj8'><b id='rPHj8'><form id='rPHj8'><ins id='rPHj8'></ins><ul id='rPHj8'></ul><sub id='rPHj8'></sub></form><legend id='rPHj8'></legend><bdo id='rPHj8'><pre id='rPHj8'><center id='rPHj8'></center></pre></bdo></b><th id='rPHj8'></th></span></q></dt></tr></i><div id='rPHj8'><tfoot id='rPHj8'></tfoot><dl id='rPHj8'><fieldset id='rPHj8'></fieldset></dl></div>
                  本文介绍了解析原始 HTTP 请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在研究由完整的 POST 和 GET 请求组成的 HTTP 流量数据集,如下所示.我已经在 java 中编写了代码,将这些请求中的每一个分开并将其保存为数组列表中的字符串元素.现在我很困惑如何在 java 中解析这些原始 HTTP 请求,有没有比手动解析更好的方法?

                  I working on HTTP Traffic Data set which is composed of complete POST and GET request Like given below. I have written code in java that has separated each of these request and saved it as string element in array list. Now i am confused how to parse these raw HTTP request in java is there any method better than manual parsing?

                  GET http://localhost:8080/tienda1/imagenes/3.gif/ HTTP/1.1
                  User-Agent: Mozilla/5.0 (compatible; Konqueror/3.5; Linux) KHTML/3.5.8 (like Gecko)
                  Pragma: no-cache
                  Cache-control: no-cache
                  Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
                  Accept-Encoding: x-gzip, x-deflate, gzip, deflate
                  Accept-Charset: utf-8, utf-8;q=0.5, *;q=0.5
                  Accept-Language: en
                  Host: localhost:8080
                  Cookie: JSESSIONID=FB018FFB06011CFABD60D8E8AD58CA21
                  Connection: close
                  

                  推荐答案

                  我 [正在] 处理 [an] HTTP 流量数据集,该数据集由完整的 POST 和 GET 请求[s] 组成

                  I [am] working on [an] HTTP Traffic Data set which is composed of complete POST and GET request[s]

                  所以你想解析一个包含多个 HTTP 请求的文件或列表.你想提取什么数据?反正这里是一个Java HTTP解析类,可以读请求行中使用的方法、版本和 URI,并将所有标头读入 Hashtable.

                  So you want to parse a file or list that contains multiple HTTP requests. What data do you want to extract? Anyway here is a Java HTTP parsing class, which can read the method, version and URI used in the request-line, and that reads all headers into a Hashtable.

                  如果您想重新发明轮子,您可以使用它或自己编写一个.查看 RFC 以了解请求在为了正确解析它:

                  You can use that one or write one yourself if you feel like reinventing the wheel. Take a look at the RFC to see what a request looks like in order to parse it correctly:

                  Request       = Request-Line              ; Section 5.1
                                      *(( general-header        ; Section 4.5
                                       | request-header         ; Section 5.3
                                       | entity-header ) CRLF)  ; Section 7.1
                                      CRLF
                                      [ message-body ]          ; Section 4.3
                  

                  这篇关于解析原始 HTTP 请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  How to send data to COM PORT using JAVA?(如何使用 JAVA 向 COM PORT 发送数据?)
                  How to make a report page direction to change to quot;rtlquot;?(如何使报表页面方向更改为“rtl?)
                  Use cyrillic .properties file in eclipse project(在 Eclipse 项目中使用西里尔文 .properties 文件)
                  Is there any way to detect an RTL language in Java?(有没有办法在 Java 中检测 RTL 语言?)
                  How to load resource bundle messages from DB in Java?(如何在 Java 中从 DB 加载资源包消息?)
                  How do I change the default locale settings in Java to make them consistent?(如何更改 Java 中的默认语言环境设置以使其保持一致?)

                      <tfoot id='oXV4C'></tfoot>
                        <bdo id='oXV4C'></bdo><ul id='oXV4C'></ul>
                      • <small id='oXV4C'></small><noframes id='oXV4C'>

                          <tbody id='oXV4C'></tbody>
                        <legend id='oXV4C'><style id='oXV4C'><dir id='oXV4C'><q id='oXV4C'></q></dir></style></legend>
                      • <i id='oXV4C'><tr id='oXV4C'><dt id='oXV4C'><q id='oXV4C'><span id='oXV4C'><b id='oXV4C'><form id='oXV4C'><ins id='oXV4C'></ins><ul id='oXV4C'></ul><sub id='oXV4C'></sub></form><legend id='oXV4C'></legend><bdo id='oXV4C'><pre id='oXV4C'><center id='oXV4C'></center></pre></bdo></b><th id='oXV4C'></th></span></q></dt></tr></i><div id='oXV4C'><tfoot id='oXV4C'></tfoot><dl id='oXV4C'><fieldset id='oXV4C'></fieldset></dl></div>