NutzCN Logo
问答 表单提交遇到乱码问题
发布于 2754天前 作者 qq_31cd2d9b 1889 次浏览 复制 上一个帖子 下一个帖子
标签:

在页面上调试,form表单提交的数据为:
regCode=http%3A%2F%2Flocalhost%2Findex&regOrg=%E5%8A%9E%E5%85%AC%E5%AE%A4%E6%B5%8B%E8%AF%952&name=%E9%BE%99%E5%85%88%E7%94%9F&phone=18683615645

从后台日志中看,后台获取到的是:
http-outgoing-1 >> "clientId=9fc2e3bfabc0c58cc88e0e2bcfdec652&regCode=http%3A%2F%2Flocalhost%2Findex&regOrg=%C3%A5%C2%8A%C2%9E%C3%A5%C2%85%C2%AC%C3%A5%C2%AE%C2%A4%C3%A6%C2%B5%C2%8B%C3%A8%C2%AF%C2%952&name=%C3%A9%C2%BE%C2%99%C3%A5%C2%85%C2%88%C3%A7%C2%94%C2%9F&phone=18683615645"

完全是两个东西。我很费解为什么会出现这种现象?

5 回复

就是使用的POST啊。后台的完整日志我发一个:
2017-05-08 19:54:45,177 [http-apr-80-exec-5] DEBUG [org.apache.http.headers] - http-outgoing-2 >> POST /iptvcloud/reg HTTP/1.1
2017-05-08 19:54:45,177 [http-apr-80-exec-5] DEBUG [org.apache.http.headers] - http-outgoing-2 >> Content-Length: 257
2017-05-08 19:54:45,178 [http-apr-80-exec-5] DEBUG [org.apache.http.headers] - http-outgoing-2 >> Content-Type: application/x-www-form-urlencoded; charset=UTF-8
2017-05-08 19:54:45,178 [http-apr-80-exec-5] DEBUG [org.apache.http.headers] - http-outgoing-2 >> Host: 192.168.11.237:8080
2017-05-08 19:54:45,178 [http-apr-80-exec-5] DEBUG [org.apache.http.headers] - http-outgoing-2 >> Connection: Keep-Alive
2017-05-08 19:54:45,178 [http-apr-80-exec-5] DEBUG [org.apache.http.headers] - http-outgoing-2 >> User-Agent: Apache-HttpClient/4.5.2 (Java/1.7.0_79)
2017-05-08 19:54:45,178 [http-apr-80-exec-5] DEBUG [org.apache.http.headers] - http-outgoing-2 >> Accept-Encoding: gzip,deflate
2017-05-08 19:54:45,178 [http-apr-80-exec-5] DEBUG [org.apache.http.wire] - http-outgoing-2 >> "POST /iptvcloud/reg HTTP/1.1[\r][\n]"
2017-05-08 19:54:45,178 [http-apr-80-exec-5] DEBUG [org.apache.http.wire] - http-outgoing-2 >> "Content-Length: 257[\r][\n]"
2017-05-08 19:54:45,178 [http-apr-80-exec-5] DEBUG [org.apache.http.wire] - http-outgoing-2 >> "Content-Type: application/x-www-form-urlencoded; charset=UTF-8[\r][\n]"
2017-05-08 19:54:45,178 [http-apr-80-exec-5] DEBUG [org.apache.http.wire] - http-outgoing-2 >> "Host: 192.168.11.237:8080[\r][\n]"
2017-05-08 19:54:45,178 [http-apr-80-exec-5] DEBUG [org.apache.http.wire] - http-outgoing-2 >> "Connection: Keep-Alive[\r][\n]"
2017-05-08 19:54:45,178 [http-apr-80-exec-5] DEBUG [org.apache.http.wire] - http-outgoing-2 >> "User-Agent: Apache-HttpClient/4.5.2 (Java/1.7.0_79)[\r][\n]"
2017-05-08 19:54:45,178 [http-apr-80-exec-5] DEBUG [org.apache.http.wire] - http-outgoing-2 >> "Accept-Encoding: gzip,deflate[\r][\n]"
2017-05-08 19:54:45,178 [http-apr-80-exec-5] DEBUG [org.apache.http.wire] - http-outgoing-2 >> "[\r][\n]"
2017-05-08 19:54:45,178 [http-apr-80-exec-5] DEBUG [org.apache.http.wire] - http-outgoing-2 >> "clientId=9fc2e3bfabc0c58cc88e0e2bcfdec652&regCode=http%3A%2F%2Flocalhost%2Findex&regOrg=%C3%A5%C2%8A%C2%9E%C3%A5%C2%85%C2%AC%C3%A5%C2%AE%C2%A4%C3%A6%C2%B5%C2%8B%C3%A8%C2%AF%C2%952&name=%C3%A9%C2%BE%C2%99%C3%A5%C2%85%C2%88%C3%A7%C2%94%C2%9F&phone=18683615645"
2017-05-08 19:54:45,189 [http-apr-80-exec-5] DEBUG [org.apache.http.wire] - http-outgoing-2 << "HTTP/1.1 200 OK[\r][\n]"
2017-05-08 19:54:45,190 [http-apr-80-exec-5] DEBUG [org.apache.http.wire] - http-outgoing-2 << "Server: Apache-Coyote/1.1[\r][\n]"
2017-05-08 19:54:45,190 [http-apr-80-exec-5] DEBUG [org.apache.http.wire] - http-outgoing-2 << "Content-Length: 0[\r][\n]"
2017-05-08 19:54:45,190 [http-apr-80-exec-5] DEBUG [org.apache.http.wire] - http-outgoing-2 << "Date: Mon, 08 May 2017 11:54:45 GMT[\r][\n]"
2017-05-08 19:54:45,190 [http-apr-80-exec-5] DEBUG [org.apache.http.wire] - http-outgoing-2 << "[\r][\n]"
2017-05-08 19:54:45,190 [http-apr-80-exec-5] DEBUG [org.apache.http.headers] - http-outgoing-2 << HTTP/1.1 200 OK
2017-05-08 19:54:45,190 [http-apr-80-exec-5] DEBUG [org.apache.http.headers] - http-outgoing-2 << Server: Apache-Coyote/1.1
2017-05-08 19:54:45,190 [http-apr-80-exec-5] DEBUG [org.apache.http.headers] - http-outgoing-2 << Content-Length: 0
2017-05-08 19:54:45,190 [http-apr-80-exec-5] DEBUG [org.apache.http.headers] - http-outgoing-2 << Date: Mon, 08 May 2017 11:54:45 GMT

然而,你贴的日志里面,参数都在url里面,并非走post body

添加回复
请先登陆
回到顶部