Jsonrpc.Server.add_handler

### Method

# Jsonrpc Serveradd_handler

#### Declaration [src]

    guint
    jsonrpc_server_add_handler (
      JsonrpcServer* self,
      const gchar* method,
      JsonrpcServerHandler handler,
      gpointer handler_data,
      GDestroyNotify handler_data_destroy
    )

#### Description [src]

Adds a new handler that will be dispatched when a matching `method` arrives.

Available since: | 3.26

#### Parameters

`method` | `const gchar*`
| A method to handle.
| The data is owned by the caller of the function.
| The value is a NUL terminated UTF-8 string.
`handler` | `JsonrpcServerHandler`
| A handler to execute when an incoming method matches `methods`.
`handler_data` | `gpointer`
| User data for `handler`.
| The argument can be `NULL`.
| The data is owned by the caller of the function.
`handler_data_destroy` | `GDestroyNotify`
| A destroy callback for `handler_data`.

#### Return value

Returns: | `guint`
| A handler id that can be used to remove the handler with `jsonrpc_server_remove_handler()`.