MCPcopy Create free account
hub / github.com/webpy/webpy / __init__

Method __init__

web/webapi.py:251–261  ·  view source on GitHub ↗
(self, cls=None)

Source from the content-addressed store, hash-verified

249 message = "method not allowed"
250
251 def __init__(self, cls=None):
252 status = "405 Method Not Allowed"
253 headers = {}
254 headers["Content-Type"] = "text/html"
255
256 methods = ["GET", "HEAD", "POST", "PUT", "DELETE"]
257 if cls:
258 methods = [method for method in methods if hasattr(cls, method)]
259
260 headers["Allow"] = ", ".join(methods)
261 HTTPError.__init__(self, status, headers, self.message)
262
263
264nomethod = NoMethod

Callers

nothing calls this directly

Calls 2

joinMethod · 0.80
__init__Method · 0.45

Tested by

no test coverage detected