我正在将以下请求从Android Java代理发送到Apache / 2.4.6 CGI perl脚本(Linux SUSE 13.1上的CGI.pm 4.38 / Perl 5.18.1)。转储$ cgi显示以下内容:
[Mon Jun 25 12:22:52.025910 2018] [cgi:error] [pid 20515] [client 192.168.0.10:56197] AH01215: $VAR1 = bless( {
[Mon Jun 25 12:22:52.025963 2018] [cgi:error] [pid 20515] [client 192.168.0.10:56197] AH01215: 'escape' => 1,
[Mon Jun 25 12:22:52.025977 2018] [cgi:error] [pid 20515] [client 192.168.0.10:56197] AH01215: '.fieldnames' => {},
[Mon Jun 25 12:22:52.026006 2018] [cgi:error] [pid 20515] [client 192.168.0.10:56197] AH01215: '.charset' => 'ISO-8859-1',
[Mon Jun 25 12:22:52.026019 2018] [cgi:error] [pid 20515] [client 192.168.0.10:56197] AH01215: 'use_tempfile' => 1,
[Mon Jun 25 12:22:52.026031 2018] [cgi:error] [pid 20515] [client 192.168.0.10:56197] AH01215: 'param' => {},
[Mon Jun 25 12:22:52.026044 2018] [cgi:error] [pid 20515] [client 192.168.0.10:56197] AH01215: '.parameters' => [],
[Mon Jun 25 12:22:52.026066 2018] [cgi:error] [pid 20515] [client 192.168.0.10:56197] AH01215: '.cgi_error' => '400 Bad request (malformed multipart POST)'
[Mon Jun 25 12:22:52.026076 2018] [cgi:error] [pid 20515] [client 192.168.0.10:56197] AH01215: }, 'CGI' );
当我使用ncat捕获请求时,我看到以下内容,但不了解哪一部分不好(请注意,^ M会自动添加到标题中)。任何帮助表示赞赏。
POST /cgi-bin/voicerec.cgi HTTP/1.1^M
Accept-Charset: UTF-8^M
Content-Type: multipart/form-data; boundary=-----OMT-164386aa112^M
User-Agent: Dalvik/1.6.0 (Linux; U; Android 4.2.2; GT-P5113 Build/JDQ39)^M
Host: 192.168.0.12:55000^M
Connection: Keep-Alive^M
Accept-Encoding: gzip^M
Content-Length: 515^M
^M
-------OMT-164386aa112
Content-Disposition: form-data; name="action"
as_voice_rec
-------OMT-164386aa112
Content-Disposition: form-data; name="S_UID"
a
-------OMT-164386aa112
Content-Disposition: form-data; name="voice"; filename="audiorecrodtest.3gp"
Content-Type: application/x-object
Here goes the voice data file content.-------OMT-164386aa112--
答案 0 :(得分:1)
-------OMT-164386aa112
Content-Disposition: form-data; name="voice"; filename="audiorecrodtest.3gp"
Content-Type: application/x-object
Here goes the voice data file content.-------OMT-164386aa112--
这部分有很多问题:没有标题结尾标记,即标题和正文之间没有空行。 MIME边界-------OMT-164386aa112--
必须从一行的开头开始。