基本上都是正常操作:启动 Scrapyd 服务,修改.cfg 文件,curl 操作 API,然后就出现了如下的 Bug(我在命令行粘贴下来的):
2019-04-06T16:31:57+0800 [_GenericHTTPChannelProtocol,35,127.0.0.1] Unhandled Error
        Traceback (most recent call last):
          File "c:\users\northxw\appdata\local\programs\python\python36\lib\site-packages\twisted\web\http.py", line 2190, in allContentReceived
            req.requestReceived(command, path, version)
          File "c:\users\northxw\appdata\local\programs\python\python36\lib\site-packages\twisted\web\http.py", line 917, in requestReceived
            self.process()
          File "c:\users\northxw\appdata\local\programs\python\python36\lib\site-packages\twisted\web\server.py", line 199, in process
            self.render(resrc)
          File "c:\users\northxw\appdata\local\programs\python\python36\lib\site-packages\twisted\web\server.py", line 259, in render
            body = resrc.render(self)
        --- <exception caught here> ---
          File "c:\users\northxw\appdata\local\programs\python\python36\lib\site-packages\scrapyd\webservice.py", line 21, in render
            return JsonResource.render(self, txrequest).encode('utf-8')
          File "c:\users\northxw\appdata\local\programs\python\python36\lib\site-packages\scrapyd\utils.py", line 20, in render
            r = resource.Resource.render(self, txrequest)
          File "c:\users\northxw\appdata\local\programs\python\python36\lib\site-packages\twisted\web\resource.py", line 249, in render
            raise UnsupportedMethod(allowedMethods)
        twisted.web.error.UnsupportedMethod: Expected one of [b'HEAD', b'object', b'POST']
看错误提示,我进入相关文件查看后,找不出异样(emmm......承认自己处理问题的能力), 不知道大家有没有遇到过相同的问题。
     1 
                    
                    midasplus      2019-04-06 18:48:21 +08:00 
                    
                    贴代码呀 
                 | 
            
     2 
                    
                    Northxw   OP @111qqz 就命令行执行了 Scrapyd 的 API 啊,比如:curl http://lcoalhost:6800/schedule.json?project=myproject。就这样就报错了。错误就是上述那样啊。 
                 | 
            
     5 
                    
                    Trim21      2019-04-06 22:44:53 +08:00 via Android 
                    
                    为什么 scrapyd 想要的 http 方法里有一个 object … 
                 | 
            
     8 
                    
                    Trim21      2019-04-06 23:36:37 +08:00 via Android 
                    
                    
                 |