如何在aiohttp中设置查询处理程序

时间:2019-09-28 10:15:53

标签: python http aiohttp

我有下一个代码:

SRVE8109W: Uncaught exception thrown by filter CompressionFilter: jav
a.io.IOException: An existing connection was forcibly closed by the remote host
        at sun.nio.ch.SocketDispatcher.writev0(Native Method)
        at sun.nio.ch.SocketDispatcher.writev(SocketDispatcher.java:55)
        at sun.nio.ch.IOUtil.write(IOUtil.java:148)
        at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:529)
        at java.nio.channels.SocketChannel.write(SocketChannel.java:493)
        at com.ibm.ws.tcpchannel.internal.NioSocketIOChannel.write(NioSocketIOCh
annel.java:206)
        at [internal classes]
        at com.ibm.worklight.management.ui.servlet.StaticContentCompressionFilte
r.writeCacheToResponse(StaticContentCompressionFilter.java:210)
        at com.ibm.worklight.management.ui.servlet.StaticContentCompressionFilte
r.doFilter(StaticContentCompressionFilter.java:135)
        at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterI
nstanceWrapper.java:194)
        at [internal classes]

[ERROR   ] SRVE0315E: An execption occurred: com.ibm.ws.webcontainer.webapp.WebA
ppErrorReport: javax.servlet.ServletException: java.io.IOException: An existing
connection was forcibly closed by the remote host
        at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterI
nstanceWrapper.java:249)
        at [internal classes]
Caused by: javax.servlet.ServletException: java.io.IOException: An existing conn
ection was forcibly closed by the remote host
        ... 3 more
Caused by: java.io.IOException: An existing connection was forcibly closed by th
e remote host
        at sun.nio.ch.SocketDispatcher.writev0(Native Method)
        at sun.nio.ch.SocketDispatcher.writev(SocketDispatcher.java:55)
        at sun.nio.ch.IOUtil.write(IOUtil.java:148)
        at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:529)
        at java.nio.channels.SocketChannel.write(SocketChannel.java:493)
        at com.ibm.ws.tcpchannel.internal.NioSocketIOChannel.write(NioSocketIOCh
annel.java:206)
        at [internal classes]
        at com.ibm.worklight.management.ui.servlet.StaticContentCompressionFilte
r.writeCacheToResponse(StaticContentCompressionFilter.java:210)
        at com.ibm.worklight.management.ui.servlet.StaticContentCompressionFilte
r.doFilter(StaticContentCompressionFilter.java:135)
        at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterI
nstanceWrapper.java:194)
        ... 1 more

[WARNING ] WARNING: Cannot set status. Response already committed.
[WARNING ] SRVE8094W: WARNING: Cannot set header. Response already committed.
[ERROR   ] Error Page Exception:

                               worklightconsole

                               /worklightconsole

                               Error Page Exception

                               com.ibm.ws.webcontainer.webapp.WebAppErrorReport:
 java.io.IOException: An existing connection was forcibly closed by the remote h
ost
        at sun.nio.ch.SocketDispatcher.writev0(Native Method)
        at sun.nio.ch.SocketDispatcher.writev(SocketDispatcher.java:55)
        at sun.nio.ch.IOUtil.write(IOUtil.java:148)
        at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:529)
        at java.nio.channels.SocketChannel.write(SocketChannel.java:493)
        at com.ibm.ws.tcpchannel.internal.NioSocketIOChannel.write(NioSocketIOCh
annel.java:206)
        at [internal classes]
        at com.ibm.worklight.management.ui.servlet.StaticContentCompressionFilte
r.writeCacheToResponse(StaticContentCompressionFilter.java:210)
        at com.ibm.worklight.management.ui.servlet.StaticContentCompressionFilte
r.doFilter(StaticContentCompressionFilter.java:135)
        at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterI
nstanceWrapper.java:194)
        at [internal classes]
Caused by: java.io.IOException: An existing connection was forcibly closed by th
e remote host
        ... 12 more

我的问题在于我无法处理以下链接:    http://localhost:8080/get_something?from=20&to=24

1 个答案:

答案 0 :(得分:0)

订阅/do_something@routes.get('/do_something'))。所有查询参数都传递到匹配的Web处理程序中。