| Safe Haskell | Safe-Infered |
|---|
Network.JsonRpc.Client
Description
This module contains the client functionality of JSON-RPC, whose specification may be read here (http://json-rpc.org/wiki/specification) for version 1 and here (http://www.jsonrpc.org/spec.html) for version 2.
By convention, a notification is represented Haskell-side by a function returning a IO (), given it doesn't care about the server's response.
Note that the functions returned by remote, notify, detailledRemote and detailledNotify need not have parameters.
- remote :: JsonRpcCall c => String -> String -> c
- detailledRemote :: JsonRpcCall c => JsonRpcVersion -> [Pair] -> String -> String -> c
- notify :: JsonRpcNotification n => String -> String -> n
- detailledNotify :: JsonRpcNotification n => JsonRpcVersion -> [Pair] -> String -> String -> n
- class JsonRpcCall a
- data JsonRpcVersion
- class JsonRpcNotification a
- data JsonRpcException
Documentation
Arguments
| :: JsonRpcCall c | |
| => String | Server URI. May contain username and password on the format username:password@ before the hostname. |
| -> String | Method name. |
| -> c | A function (ToJSON x1...ToJSON xn, FromJSON y) => x1 -> ... -> xn -> IO y |
Call a remote function via JSON-RPC, using version 2 of the protocol and HTTP POST as its transport
Arguments
| :: JsonRpcCall c | |
| => JsonRpcVersion | Protocol's version. |
| -> [Pair] | Custom JSON elements to add to the request |
| -> String | Server URI. May contain username and password on the format username:password@ before the hostname. |
| -> String | Method name. |
| -> c | A function (ToJSON x1...ToJSON xn, FromJSON y) => x1 -> ... -> xn -> IO y |
Call a remote function via JSON-RPC, specifying the protocol's version to use and customs elements to add to the request
Arguments
| :: JsonRpcNotification n | |
| => String | Server URI. May contain username and password on the format username:password@ before the hostname. |
| -> String | Notification name. |
| -> n | A function (ToJSON x1...ToJSON xn) => x1 -> ... -> xn -> IO () |
Call a remote notification on a JSON-RPC server, using version 2 of the protocol and HTTP POST as its transport
Arguments
| :: JsonRpcNotification n | |
| => JsonRpcVersion | Protocol's version. |
| -> [Pair] | Custom JSON elements to add to the request |
| -> String | Server URI. May contain username and password on the format username:password@ before the hostname. |
| -> String | Notification name. |
| -> n | A function (ToJSON x1...ToJSON xn, FromJSON y) => x1 -> ... -> xn -> IO y |
Call a remote notification on a JSON-RPC server, specifying the protocol's version to use and customs elements to add to the request
class JsonRpcCall a Source
Type of functions representable in JSON-RPC
Instances
| FromJSON a => JsonRpcCall (IO a) | |
| (ToJSON a, JsonRpcCall b) => JsonRpcCall (a -> b) |
data JsonRpcVersion Source
Datatype representing the protocol's version in use during a call or notification.
class JsonRpcNotification a Source
Type of notifications representable in JSON-RPC
Instances
| JsonRpcNotification (IO ()) | |
| (ToJSON a, JsonRpcNotification b) => JsonRpcNotification (a -> b) |
data JsonRpcException Source
The exception type returned by Network.JsonRpc.Client's functions when an error appens