This module provides util functions to build ReviewBoard requests.
The current implementation is maybe an overkill for a project of this size,
but it provides some constants for URL path elements and definitely simplifies
building API calls.
The request format is method (path1 . path2 . path3) [form var]
, for example the API GET call to
/api/json/reviewrequests/5/delete/ can be executed by calling
apiGet (reviewrequests (Just 5) . delete) []
The supported methods are apiGet, apiPost, httpGet and httpPost.
Http methods may be used to perform direct requests to ReviewBoard web UI
that are not supported by the API. As an example see rbpatch command
line tool in examples. Http methods, same as API methods return RBResponse
object with a JSValue result of the form:
{ "head": [
{ "name" : <header name>,
"value": <header value> }
]
"body" : <content>
}
The current approach to handle requests may change if I find a way
to automatically generate API calls from ReviewBoard code.
|