RESTful Functions Overview: Difference between revisions
(Created page with "The RESTful macro functions in MapTool are for advanced users. This is merely an overview of the MapTool implementation of RESTful functions and not a tutorial covering REST...") |
No edit summary |
||
(6 intermediate revisions by 4 users not shown) | |||
Line 3: | Line 3: | ||
== What is REST? == | == What is REST? == | ||
REST is acronym for REpresentational State Transfer. It is architectural style for distributed hypermedia systems and was first presented by Roy Fielding in 2000 in his [https://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm famous dissertation]. | REST is acronym for REpresentational State Transfer. It is an architectural style for distributed hypermedia systems and was first presented by Roy Fielding in 2000 in his [https://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm famous dissertation]. | ||
(''Definition from tutorial linked above.'') | (''Definition from tutorial linked above.'') | ||
Line 16: | Line 16: | ||
* Delete - {{func|REST.delete}} | * Delete - {{func|REST.delete}} | ||
See the entry for each macro function for details about their use. | |||
The full response will include a status code. A partial list: | == REST Status Codes == | ||
Each request can return the server response or a full response with data typically in a XML or JSON format. Note that XML data can be more easily processed using {{func|herolab.XPath}} (the prefix is {{code|herolab}} but it's a general purpose function). | |||
The full response will include a status code. A partial list of status codes: | |||
{|class="wikitable" | {|class="wikitable" | ||
Line 33: | Line 37: | ||
|404||Not Found | |404||Not Found | ||
|} | |} | ||
[[Category:MapTool]][[Category:RESTful Function]] |
Latest revision as of 23:59, 27 April 2023
The RESTful macro functions in MapTool are for advanced users. This is merely an overview of the MapTool implementation of RESTful functions and not a tutorial covering REST and REST APIs. Those can be readily found on the web such as REST API Tutorial.
What is REST?
REST is acronym for REpresentational State Transfer. It is an architectural style for distributed hypermedia systems and was first presented by Roy Fielding in 2000 in his famous dissertation.
(Definition from tutorial linked above.)
MapTool REST Operations
MapTool supports the following REST requests:
- Get - REST.get()
- Post - REST.post()
- Put - REST.put()
- Patch - REST.patch()
- Delete - REST.delete()
See the entry for each macro function for details about their use.
REST Status Codes
Each request can return the server response or a full response with data typically in a XML or JSON format. Note that XML data can be more easily processed using herolab.XPath() (the prefix is herolab
but it's a general purpose function).
The full response will include a status code. A partial list of status codes:
200 | OK |
201 | Created |
202 | Accepted |
204 | No Content |
400 | Bad Request |
404 | Not Found |