Web Services
Igor webservices are capable of describing HTTP services. From this description, HTTP client or HTTP server (or both) can be generated for the target language.
Syntax
webservice WebserviceName
{
// request
ResourceName => HttpVerb /path/parts?query1=value1&query2=value2 ~Header1:Header1Value Content as ContentType ->
// 200 response
200 OK: ~Header1:Header1Value Content as ContentType,
// 404 response
404 Not Found: ~HeaderI:HeaderIValue 404Content as ContentType,
...;
...
}
where
WebserviceNameis the webservice name identifierResourceNameis the name of resource. It is used for generating HTTP client API and HTTP server callback function namesHttpVerb:GET,PUT,POST,DELETEorPATCH/path/parts?query1=value1&query2=value2are the URI path and query parts, that can contain variablesHeaderX,HeaderXValueare the optional header names and values (values can be variables)Contentis the type name or variable definition of request contentas ContentTypeis the optional content type specifier, e.g. json, binary, xml (json by default)200 OKor similar are the optional status code & phease (there may be multiple status codes supported)