haxr-3000.11.3: XML-RPC client and server library.

Copyright | (c) Bjorn Bringert 2003
License | BSD-style
Maintainer | bjorn@bringert.net
Stability | experimental
Portability | non-portable (requires extensions and non-portable libraries)
Safe Haskell | None
Language | Haskell2010

Network.XmlRpc.Client

Description

This module contains the client functionality of XML-RPC. The XML-RPC specifcation is available at http://www.xmlrpc.com/spec.

A simple client application:

    import Network.XmlRpc.Client

    server = "http://localhost/~bjorn/cgi-bin/simple_server"

    add :: String -> Int -> Int -> IO Int
    add url = remote url "examples.add"

    main = do
           let x = 4
               y = 7
           z <- add server x y
           putStrLn (show x ++ " + " ++ show y ++ " = " ++ show z)

Synopsis

- remote :: Remote a => String -> String -> a
- remoteWithHeaders :: Remote a => String -> String -> HeadersAList -> a
- call :: String -> String -> [Value] -> Err IO Value
- callWithHeaders :: String -> String -> HeadersAList -> [Value] -> Err IO Value
- class Remote a

# Documentation

remote Source #

Arguments

:: Remote a |
=> String | Server URL. May contain username and password on the format username:password@ before the hostname.
-> String | Remote method name.
-> a | Any function `(XmlRpcType t1, ..., XmlRpcType tn, XmlRpcType r) => t1 -> ... -> tn -> IO r`

Call a remote method.

remoteWithHeaders Source #

Arguments

:: Remote a |
=> String | Server URL. May contain username and password on the format username:password@ before the hostname.
-> String | Remote method name.
-> HeadersAList | Extra headers to add to HTTP request.
-> a | Any function `(XmlRpcType t1, ..., XmlRpcType tn, XmlRpcType r) => t1 -> ... -> tn -> IO r`

Call a remote method. Takes a list of extra headers to add to the HTTP request.

call Source #

Arguments

:: String | URL for the XML-RPC server.
-> String | Method name.
-> [Value] | The arguments.
-> Err IO Value | The result

Low-level method calling function. Use this function if you need to do custom conversions between XML-RPC types and Haskell types. Throws an exception if the response was a fault.

callWithHeaders Source #

Arguments

:: String | URL for the XML-RPC server.
-> String | Method name.
-> HeadersAList | Extra headers to add to HTTP request.
-> [Value] | The arguments.
-> Err IO Value | The result

Low-level method calling function. Use this function if you need to do custom conversions between XML-RPC types and Haskell types. Takes a list of extra headers to add to the HTTP request. Throws an exception if the response was a fault.

class Remote a Source #

Minimal complete definition

remote_

Instances

XmlRpcType a => Remote (IO a) Source # |
Instance details Defined in Network.XmlRpc.Client Methods remote_ :: (String -> String) -> ([Value] -> Err IO Value) -> IO a
(XmlRpcType a, Remote b) => Remote (a -> b) Source # |
Instance details Defined in Network.XmlRpc.Client Methods remote_ :: (String -> String) -> ([Value] -> Err IO Value) -> a -> b