<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 请求

        时间:2023-10-13

            <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 请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:在 Content-Type 中指定字符集时,Jersey 和 @FormParam 不起作用 下一篇:在 Java 中,如何在不生成 String 对象的情况下从 HttpServletRequest 标头中提取密码?

                  相关文章

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

                    <legend id='oXV4C'><style id='oXV4C'><dir id='oXV4C'><q id='oXV4C'></q></dir></style></legend>
                  2. <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>