今天在测试接口,模拟请求获取数据时,结果发现客户端有这么一个错误。
报错代码如下:
Jun 01, 2017 10:21:52 AM org.apache.coyote.http11.AbstractHttp11Processor processINFO: Error parsing HTTP request header Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level.java.lang.IllegalArgumentException: Invalid character found in method name. HTTP method names must be tokens at org.apache.coyote.http11.InternalNioInputBuffer.parseRequestLine(InternalNioInputBuffer.java:266) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:996) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:623) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1756) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1715) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:724)
经过Debug发现,参数中URL的协议写错了,请求的 http://xxx.com/data 结果写成了 https://xxx.com/data,修改https 为 http,搞定
未经允许请勿转载:程序喵 » 关于Invalid character found in method name. HTTP method names must be tokens的问题