Class ::nsmcp::HttpTransport

::nsmcp::HttpTransport[i] create ... \
           [ -allowedOrigins (default "") ] \
           [ -authenticator:required authenticator:required ] \
           [ -maxBodyBytes:integer (default "65536") ] \
           [ -protocol:required protocol:required ]

Defined in /usr/local/ns/tcl/nsmcp/transport.tcl

Class Relations

  • class: ::nx::Class[i]
  • superclass: ::nsmcp::Object[i]

Methods (to be applied on instances)

  • maxBodyBytes (scripted, public)

     <instance of nsmcp::HttpTransport[i]> maxBodyBytes

    Return the configured MCP request-body limit. The server adapter uses this bound before accepting or reading the request body.

    Returns:
    The maximum body size in bytes.

    Testcases:
    No testcase defined.
  • mediaTypes (scripted, public)

     <instance of nsmcp::HttpTransport[i]> mediaTypes header

    Normalize a comma-separated media-type header. Ignore media-type parameters while retaining the lower-case type names used for negotiation.

    Parameters:
    header (required)
    Comma-separated media-type header value.
    Returns:
    The normalized media-type list.

    Testcases:
    No testcase defined.
  • questionPoll (scripted, public)

     <instance of nsmcp::HttpTransport[i]> questionPoll authorization \
        server key handle

    Authenticate and dispatch an administrative question poll operation. Apply the question credential policy and always clean up the temporary request context.

    Parameters:
    authorization (required)
    Authorization header supplied by the caller.
    server (required)
    Selected NaviServer virtual-server name.
    key (required)
    Administrative question-poll operation selector.
    handle (required)
    Retained job or conversation handle; ownership and expiry checks still apply.
    Returns:
    The internal HTTP response descriptor.

    Testcases:
    No testcase defined.
  • request (scripted, public)

     <instance of nsmcp::HttpTransport[i]> request method headers body \
        server

    Handle one MCP HTTP request using normalized headers. Apply origin, method, media-type, authentication and protocol checks before dispatch; clean up request-owned objects on exit.

    Parameters:
    method (required)
    MCP protocol method or HTTP method, depending on the adapter.
    headers (required)
    HTTP header dictionary using lower-case field names.
    body (required)
    Serialized HTTP or JSON-RPC request body.
    server (required)
    Selected NaviServer virtual-server name.
    Returns:
    The internal HTTP response descriptor.

    Testcases:
    No testcase defined.
  • response (scripted, public)

     <instance of nsmcp::HttpTransport[i]> response status body \
        [ headers ]

    Construct an internal HTTP response descriptor. Keep the status, serialized body and header dictionary together for the server adapter.

    Parameters:
    status (required)
    HTTP response status.
    body (required)
    Serialized HTTP or JSON-RPC request body.
    headers (optional)
    HTTP header dictionary using lower-case field names.
    Returns:
    The response dictionary with status, body and headers.

    Testcases:
    No testcase defined.