Houdini 19.0 hwebserver

hwebserver.notFoundResponse function

Generates a Response object representing a 404 Not Found HTTP error.

notFoundResponse(request):hwebserver.Response

This convenience function automatically sets the response code to 404 and generates an error message to indicate the requested resource was not found or does not exist.

import hou
import hwebserver


@hwebserver.urlHandler("/node/info/", is_prefix=True)
def node_info(request):
    path = request.path()
    assert path.startswith("/node/info")
    node_path = path[10:]
    node = hou.node(node_path)
    if node is None:
        return hwebserver.notFoundResponse(request)
    # ...
See also

hwebserver

クラス

開始と停止

ウェブリクエストの処理とレスポンスの返し

ウェブソケット

  • WebSocket

    Base class for WebSocket support with the embedded server.

  • hwebserver.webSocket

    Decorator for registering WebSocket classes with Houdini’s web server.

APIコール

  • hwebserver.apiFunction

    Decorator for functions that can be called through an API endpoint on Houdini’s web server, returning JSON or binary responses.

  • hwebserver.APIError

    Raise this exception in apiFunction handlers to indicate an error.