5,838
edits
m (→Where to use) |
m (→"GET" approach) |
||
|
== "GET" approach ==
You may have used GET as an attribute when defining the action of a HTML form. Equally you might in a script language access the query-string part of a Universal Resource Locator to get parameters for what the script is to supply to the web page. Even if you don't understand the meaning of those technical terms, you probably have seen when using a browser (in the box where a URL is entered) that sometimes the URL seen there has a query-string. You will have seen a question mark (?) followed by one or [separated by ampersand (&)] more '''name=value''' parameters.
The GET approach to using the Cumulus general api works in this way indicating the start of a query-string with a question mark and using ampersands to separate names. The difference is that a tag name (or list of tag names) is used instead of a name=value parameter (or list of name=value parameters).
Suppose you want to get the values for the following three web tags:
The first parameter is '''rc''' to indicate that the tags that follow are to use decimal points not decimal commas, which is how many script languages expect to see values.
Remember that in
# <#temp rc=y>
# <#hum rc=y>
# <#dew rc=y>
Since '''rc=y''' can be applied to several web tags that don't appear in [[Webtags#No_Commas]] table, this shows how the api can access values without commas for
If you are using the api in a context where it does not matter if decimal commas or decimal points are in the api or for any tags that don't report in real numbers, simply omit the '''rc''' as first item, and just include tag names separated by ampersands.
=== JavaScript example ===
| |||
edits