POST 请求的body 数据较大,约1.5M 大小,报错信息如下:
java.net.SocketException: Broken pipe (Write failed) at java.net.SocketOutputStream.socketWrite0(Native Method) ~[na:1.8.0_122-ea] at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109) ~[na:1.8.0_122-ea] at java.net.SocketOutputStream.write(SocketOutputStream.java:153) ~[na:1.8.0_122-ea] at HTTPClient.HTTPConnection.writeData(HTTPConnection.java:3347) ~[grinder-httpclient-3.9.1.jar:na] at HTTPClient.HTTPConnection.sendRequest(HTTPConnection.java:3203) ~[grinder-httpclient-3.9.1.jar:na] at HTTPClient.HTTPConnection.handleRequest(HTTPConnection.java:2883) ~[grinder-httpclient-3.9.1.jar:na] at HTTPClient.HTTPConnection.setupRequest(HTTPConnection.java:2675) ~[grinder-httpclient-3.9.1.jar:na] at HTTPClient.HTTPConnection.Post(HTTPConnection.java:1177) ~[grinder-httpclient-3.9.1.jar:na] at net.grinder.plugin.http.HTTPRequest$8.doRequest(HTTPRequest.java:923) ~[grinder-http-3.9.1.jar:na] at net.grinder.plugin.http.HTTPRequest$AbstractRequest.getHTTPResponse(HTTPRequest.java:1276) ~[grinder-http-3.9.1.jar:na] at net.grinder.plugin.http.HTTPRequest.POST(HTTPRequest.java:918) ~[grinder-http-3.9.1.jar:na] at net.grinder.plugin.http.HTTPRequest.POST(HTTPRequest.java:896) ~[grinder-http-3.9.1.jar:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_122-ea] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_122-ea] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_122-ea] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_122-ea] at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:186) ~[jython-standalone-2.5.3.jar:na] at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:204) ~[jython-standalone-2.5.3.jar:na] at org.python.core.PyObject.__call__(PyObject.java:422) ~[jython-standalone-2.5.3.jar:na] at org.python.core.PyObject.__call__(PyObject.java:426) ~[jython-standalone-2.5.3.jar:na] at org.python.core.PyMethod.__call__(PyMethod.java:139) ~[jython-standalone-2.5.3.jar:na] at org.python.pycode._pyx1.pms$2(${NGRINDER_HOME}/script/dingzhi/PMS.py:61) ~[na:na] at org.python.pycode._pyx1.call_function(${NGRINDER_HOME}/script/dingzhi/PMS.py) ~[na:na] at org.python.core.PyTableCode.call(PyTableCode.java:165) ~[jython-standalone-2.5.3.jar:na] at org.python.core.PyBaseCode.call(PyBaseCode.java:166) ~[jython-standalone-2.5.3.jar:na] at org.python.core.PyFunction.__call__(PyFunction.java:338) ~[jython-standalone-2.5.3.jar:na] at org.python.core.PyMethod.__call__(PyMethod.java:139) ~[jython-standalone-2.5.3.jar:na] at org.python.pycode._pyx1.__call__$3(${NGRINDER_HOME}/script/dingzhi/PMS.py:69) ~[na:na] at org.python.pycode._pyx1.call_function(${NGRINDER_HOME}/script/dingzhi/PMS.py) ~[na:na] at org.python.core.PyTableCode.call(PyTableCode.java:165) ~[jython-standalone-2.5.3.jar:na] at org.python.core.PyBaseCode.call(PyBaseCode.java:301) ~[jython-standalone-2.5.3.jar:na] at org.python.core.PyBaseCode.call(PyBaseCode.java:194) ~[jython-standalone-2.5.3.jar:na] at org.python.core.PyFunction.__call__(PyFunction.java:387) ~[jython-standalone-2.5.3.jar:na] at org.python.core.PyMethod.instancemethod___call__(PyMethod.java:220) ~[jython-standalone-2.5.3.jar:na] at org.python.core.PyMethod.__call__(PyMethod.java:211) ~[jython-standalone-2.5.3.jar:na] at org.python.core.PyMethod.__call__(PyMethod.java:206) ~[jython-standalone-2.5.3.jar:na] at org.python.core.PyObject.invoke(PyObject.java:3555) ~[jython-standalone-2.5.3.jar:na] at org.python.core.PyInstance.instance___call__(PyInstance.java:351) ~[jython-standalone-2.5.3.jar:na] at org.python.core.PyInstance.__call__(PyInstance.java:342) ~[jython-standalone-2.5.3.jar:na] at org.python.core.PyObject.__call__(PyObject.java:371) ~[jython-standalone-2.5.3.jar:na] at net.grinder.scriptengine.jython.JythonScriptEngine$JythonWorkerRunnable.run(JythonScriptEngine.java:250) ~[grinder-core-3.9.1.jar:na] at net.grinder.engine.process.GrinderThread.run(GrinderThread.java:118) ~[grinder-core-3.9.1.jar:na] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_122-ea] |
经过验证发现,post 请求字符串长度较短时,不会报错,并且在使用groovy脚本发送相同请求时,报错说 :String too long. The given string is 924088 Unicode code units long, but only a maximum of 65535 is allowed.
请问代码中是否有控制POST 请求最大body 的长度 |
Free forum by Nabble | Edit this page |