Water 5-System Interfaces-HTTPContract| Parameter key | Default value | Type | | obj | "" | string | | user_info | opt | | host | opt | | port | 80 | integer | | protocol | opt | string | | path | null | type.<one_of string thing/> | | query | opt | type.<one_of string thing/> | | auth_type | "Basic" | string | | username | opt | | password | opt | | fragment | null | | name | opt | | header | opt | | protocol_version | 1.0 | double | | content_type | opt | | method | "get" | type.<one_of "get" "post" "put" "options" "delete" "head"/> | | use_caches | false | boolean | | path_string | "" | string | | body | opt | | extension | "" | string | | of | of | instances | | body_string | "" | string | | Water Contract<class request_or_response.uri
obj =""
user_info =opt
host =opt
port =80=number.integer
protocol =opt=string
path =null=<type.one_of string thing/>
query =opt=<type.one_of string thing/>
auth_type ="Basic"
username =opt
password =opt
fragment =null
name =opt
header =opt
protocol_version=1.0
content_type =opt
method ="get"=<type.one_of "get" "post" "put" "options" "delete" "head"/>
use_caches =false
path_string =""
body =opt
extension =""
of =<instances system=<request_or_response.uri host="system" protocol="logical" name="system" physical_uri=<request_or_response.uri host="" protocol="file" path=<vector "" "Users" "mseelig" "Documents" "workspace" "steam_working"/> path_string="/Users/mseelig/Documents/workspace/steam_working"/>/> water_test=<request_or_response.uri host="water_test" protocol="logical" name="water_test" physical_uri=<request_or_response.uri path=<vector "" "Users" "mseelig" "Documents" "workspace" "steam_working" "test"/> path_string="/Users/mseelig/Documents/workspace/steam_working/test"/>/> user=<request_or_response.uri host="user" protocol="logical" name="user" physical_uri=<request_or_response.uri host="" protocol="file" path=<vector "" "Users" "mseelig" "water_user_folder"/> path_string="/Users/mseelig/water_user_folder"/>/> water_runtime=<request_or_response.uri host="water_runtime" protocol="logical" name="water_runtime" physical_uri=<request_or_response.uri host="" protocol="file" path=<vector "" "Users" "mseelig" "Documents" "workspace" "steam_working"/> path_string="/Users/mseelig/Documents/workspace/steam_working"/>/> _name="of" water_ide=<request_or_response.uri host="water_ide" protocol="logical" name="water_ide" physical_uri=<request_or_response.uri host="" protocol="file" path=<vector "" "Users" "mseelig" "Documents" "workspace" "steam_working"/> path_string="/Users/mseelig/Documents/workspace/steam_working"/>/> product=<request_or_response.uri host="product" protocol="logical" name="product" physical_uri=<request_or_response.uri host="" protocol="file" path=<vector "" "Users" "mseelig" "Documents" "workspace" "steam_working"/> path_string="/Users/mseelig/Documents/workspace/steam_working"/>/> water_reference_doc=<request_or_response.uri host="water_reference_doc" protocol="logical" name="water_reference_doc" physical_uri=<request_or_response.uri path=<vector "" "Users" "mseelig" "Documents" "workspace" "steam_working" "doc"/> path_string="/Users/mseelig/Documents/workspace/steam_working/doc"/>/>/>
body_string =""
/> | |
A Water URI supports the URI specification from the W3C.
A URI is a uniform resource identifier and is used for
identifying resources on the Web. A URI can be created
in many different ways:
Parts of a URI encoded in a URI string:
<uri "http://www.clearmethods.com:8080/prod/buy?item=10"/>.<to_uri/>
 | "http://www.clearmethods.com:8080/prod/buy?item=10" |
Parts of a URI specified as separate fields:
<uri port=8080 host="www.clearmethods.com" protocol="http"
query=<thing item=10/> path=<vector "" "prod" "buy"/>
/>.<to_uri/> | "http://www.clearmethods.com:8080/prod/buy?item=10" |
Example of combining two URIs together:
<uri "http://www.clearmethods.com"/>.<uri "foo/bar"/>.<to_uri/>
 | "http://www.clearmethods.com/foo/bar" |
A Water URI can have additional information such as the HTTP method
(GET, POST, etc.), HTTP header values, and body content.
<uri "http://www.clearmethods.com"
method="post"
header=<thing Accept="*/*"/>
content_type="application/x-www-form-urlencoded"
body=<thing item=10/>
/> | <thing host="www.clearmethods.com" protocol="http" path=<vector/> header=<thing Accept="*/*"/> content_type="application/x-www-form-urlencoded" method="post" path_string="" body=<thing item=10/> body_string="item=10"/>.<set _encoded_set_key_parent=uri/> |
You can create relative URIs that do not have a protocol or host:
<uri "foo/bar"/>.<to_uri/>
"foo/bar"
URIs are intended to be read-only (immutable) data structures.
Once you create them, you should not modify them, but you can
create new URIs from existing URIs.
wob.<set a_uri=
<uri "http://merlin:password@nitric.com:80/internal/foo?bar=2&baz=3#someplace"/>
/>
a_uri.protocol
"http" a_uri.user_info
"merlin:password" a_uri.host
"nitric.com" a_uri.port
80 a_uri.path
 | <vector "" "internal" "foo"/>
|
a_uri.path_string
"/internal/foo" a_uri.query_string
"bar=2&baz=3" a_uri.query
 | <thing bar=2 baz=3/>
|
a_uri.fragment
"someplace" <uri "foo/bar?a=2&b=3"/>.query_string
 | "b=3&a=2" |
<uri "foo/bar?a=2&b=xxx"/>.query
 | <thing a=2 b="xxx"/>
|
<uri "foo/bar?"/>.query_string
 | "" |
<uri "foo/bar?"/>.query
 | <thing/>
|
<uri "foo/bar"/>.query_string
"" <uri "foo/bar"/>.query
opt
In file protocols user_info, host, port, and query are all irrelevant.
user_info, host and query are the empty string. Port is ignored.
Note that the "file" protocol is used for folders as well, though
Water does have both file and folder resource objects.
© Copyright 2007 Clear Methods, Inc.