{"id":184173,"date":"2022-04-26T14:07:54","date_gmt":"2022-04-26T14:07:54","guid":{"rendered":"https:\/\/www.actcom.dk\/rest-representational-state-transfer\/"},"modified":"2022-04-26T14:07:54","modified_gmt":"2022-04-26T14:07:54","slug":"rest-representational-state-transfer","status":"publish","type":"post","link":"https:\/\/www.actcom.dk\/da\/rest-representational-state-transfer\/","title":{"rendered":"REST &#8211; REpresentational State Transfer"},"content":{"rendered":"<section class=\"c-category\">\n<h3>REST &#8211; Transmission on the network level<\/h3>\n<p class=\"c-justify\">It should be said in advance that REST uses HTTP or HTTPS as the higher level protocol.<\/p>\n<div class=\"c-center\"><img decoding=\"async\" src=\"\/wp-content\/uploads\/images\/Information\/e-57www-18-pius-000.png\" width=\"600\" \/><\/div>\n<p class=\"c-justify\">The advantage of HTTP(S) as a communication basis is that most networks, even those protected by firewalls etc., are fully usable for HTTP(S). In addition, HTTP(S) has the characteristics that REST requires.<\/p>\n<p class=\"c-justify\">As is common in the case of HTTP and HTTPS, TCP ports 80 and 443 are used.<\/p>\n<\/section>\n<hr \/>\n<section class=\"c-category\">\n<h3>REST &#8211; Properties and basic elements<\/h3>\n<p class=\"c-justify\"><b>Client\/Server Model<\/b><br \/>REST is based on the Client\/Server model, where an action is always initiated by the client. The server provides resources (data, content, functions). The client sends a request to access selected resources. The server replies with the requested data or confirms the desired action.<\/p>\n<p class=\"c-justify\"><b>Stateless condition<\/b><br \/>In many Client\/Server applications when the server opens a connection a particular status (authorization, special task, specific purpose, &#8230;) is assigned which remains in effect for the duration of the connection. REST at first treats everything incoming from the server the same, and only the content of the data transfer determines what proceeds on the server side and how the request is classified. The status of an application thus lies in the hands of the client.<\/p>\n<p class=\"c-justify\"><b>Layered system<\/b><br \/>REST provides for clear separation of responsibilities. This separation applies in particular to how communication is handled and the processing of the transported contents.<\/p>\n<p class=\"c-justify\">This makes it possible to use proxies, gateways or similar intermediate stations along the transmission path.<\/p>\n<p class=\"c-justify\">In addition, HTTP or encrypted transmission via HTTPS can be selected depending on the security requirements. Which is used has no effect on the functionality of the REST contents.<\/p>\n<p class=\"c-justify\"><b>Addressability of resources<\/b><br \/>All resources available on a server are accessible using a unique address (URI &#8211; Uniform Resource Identifier). The URI is structured like the URL which is used for addressing in the browser:<\/p>\n<p><code>Protokoll:\/\/<Host \/>:<Port \/>\/<Pfad \/>\/<Ressource \/>?<Parameter \/>&<Parameter \/><\/code><\/p>\n<p class=\"c-justify\"><b>Request methods<\/b><br \/>Standardized HTTP requests can be used:<\/p>\n<ul class=\"c-bulletlist\">\n<li><b>GET<\/b><br \/>requests resources from the server and is then used read-only\n<\/li>\n<li><b>POST<\/b><br \/>posts new resources or changes existing ones\n<\/li>\n<li><b>PUT<\/b><br \/>changes existing resources\n<\/li>\n<li><b>DELETE<\/b><br \/>deletes existing resources\n<\/li>\n<li><b>HEAD<\/b><br \/>requests only the HTTP head, for example to check the availability of the requested resource\n<\/li>\n<li><b>OPTIONS<\/b><br \/>requests information about the communication options<\/li>\n<\/ul>\n<p class=\"c-justify\">The data requested are referred to as representations of one or more resources. Hence the term REST for REpresentational State Transfer.<\/p>\n<p class=\"c-justify\">Representations are basically nothing more than an image of parts of the process data. Transmission can be in any agreed upon form. Common are JSON, XML or raw text. SVG, MP3 or other formats can however also be used dependiong on the application. Representations may also contain hyperlinks to additional resources.<\/p>\n<p class=\"c-justify\">The client sends:<\/p>\n<p><code>http:\/\/192.168.1.19\/rest\/json\/iostate\/<\/code><\/p>\n<p class=\"c-justify\">And the Web Thermo-Hygrobarometer sends in reply:<\/p>\n<p><code>{<br \/>\u00a0\u00a0\"iostate\": {<br \/>\u00a0\u00a0\u00a0\u00a0\"sensor\": [<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"name\": \"Temperatur\",<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"number\": 0,<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"unit\": \"\u00b0C\",<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"value\": 25.9<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0},<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"name\": \"rel. Feuchte\",<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"number\": 1,<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"unit\": \"%\",<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"value\": 43.2<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0},<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"name\": \"Luftdruck\",<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"number\": 2,<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"unit\": \"hPa\",<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"value\": 994.7<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<br \/>\u00a0\u00a0\u00a0\u00a0]<br \/>\u00a0\u00a0}<br \/>}<\/code><\/p>\n<p class=\"c-justify\"><b>Code on Demand<\/b><br \/>For websites it is usual today to also include JavaScript for example. REST also allows you to later include source code, program sections or function blocks. This enables the client function to be expanded or modified during runtime.<\/p>\n<p class=\"c-justify\"><b>Cache<\/b><br \/>REST provides for responding to repeated client generated requests from a cache in order to reduce the data load on the transmission channels. The server uses corresponding entries in the HTTP head to determine whether the cache is allowed to be used for the requested representation or not.<\/p>\n<p class=\"c-justify\"><b>Advantages of REST<\/b><br \/>Simple implementation, since HTTP mechanisms are used for the most part.<\/p>\n<p class=\"c-justify\"><b>Disadvantages of REST<\/b><br \/>The request\/reply methodology means that only polling &#8211; i.e. targeted calling of data &#8211; is possible, but not event-driven communication. The relevant data must be continuously polled in order to detect changes.<\/p>\n<\/section>\n","protected":false},"excerpt":{"rendered":"<h2>Industrial communication based on standardized HTTP requests<\/h2>\n<p>REST does not describe an actual protocol structure. Rather REST prescribes properties which should be met for data communication in industrial environments.<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-184173","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v28.9 (Yoast SEO v28.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>REST - REpresentational State Transfer - actcom<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.actcom.dk\/da\/rest-representational-state-transfer\/\" \/>\n<meta property=\"og:locale\" content=\"da_DK\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"REST - REpresentational State Transfer\" \/>\n<meta property=\"og:description\" content=\"Industrial communication based on standardized HTTP requests REST does not describe an actual protocol structure. Rather REST prescribes properties which should be met for data communication in industrial environments.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.actcom.dk\/da\/rest-representational-state-transfer\/\" \/>\n<meta property=\"og:site_name\" content=\"actcom\" \/>\n<meta property=\"article:published_time\" content=\"2022-04-26T14:07:54+00:00\" \/>\n<meta name=\"author\" content=\"Jens - admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Skrevet af\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jens - admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimeret l\u00e6setid\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutter\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.actcom.dk\\\/da\\\/rest-representational-state-transfer\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.actcom.dk\\\/da\\\/rest-representational-state-transfer\\\/\"},\"author\":{\"name\":\"Jens - admin\",\"@id\":\"https:\\\/\\\/www.actcom.dk\\\/da\\\/#\\\/schema\\\/person\\\/a57fc9a95719d303e3ca50650d89fdeb\"},\"headline\":\"REST &#8211; REpresentational State Transfer\",\"datePublished\":\"2022-04-26T14:07:54+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.actcom.dk\\\/da\\\/rest-representational-state-transfer\\\/\"},\"wordCount\":598,\"publisher\":{\"@id\":\"https:\\\/\\\/www.actcom.dk\\\/da\\\/#organization\"},\"articleSection\":[\"Uncategorized\"],\"inLanguage\":\"da-DK\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.actcom.dk\\\/da\\\/rest-representational-state-transfer\\\/\",\"url\":\"https:\\\/\\\/www.actcom.dk\\\/da\\\/rest-representational-state-transfer\\\/\",\"name\":\"REST - REpresentational State Transfer - actcom\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.actcom.dk\\\/da\\\/#website\"},\"datePublished\":\"2022-04-26T14:07:54+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.actcom.dk\\\/da\\\/rest-representational-state-transfer\\\/#breadcrumb\"},\"inLanguage\":\"da-DK\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.actcom.dk\\\/da\\\/rest-representational-state-transfer\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.actcom.dk\\\/da\\\/rest-representational-state-transfer\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.actcom.dk\\\/da\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"REST &#8211; REpresentational State Transfer\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.actcom.dk\\\/da\\\/#website\",\"url\":\"https:\\\/\\\/www.actcom.dk\\\/da\\\/\",\"name\":\"actcom\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.actcom.dk\\\/da\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.actcom.dk\\\/da\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"da-DK\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.actcom.dk\\\/da\\\/#organization\",\"name\":\"actcom\",\"url\":\"https:\\\/\\\/www.actcom.dk\\\/da\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"da-DK\",\"@id\":\"https:\\\/\\\/www.actcom.dk\\\/da\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.actcom.dk\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/atcomlogo.png\",\"contentUrl\":\"https:\\\/\\\/www.actcom.dk\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/atcomlogo.png\",\"width\":215,\"height\":68,\"caption\":\"actcom\"},\"image\":{\"@id\":\"https:\\\/\\\/www.actcom.dk\\\/da\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.actcom.dk\\\/da\\\/#\\\/schema\\\/person\\\/a57fc9a95719d303e3ca50650d89fdeb\",\"name\":\"Jens - admin\",\"sameAs\":[\"http:\\\/\\\/www.actcom.dk\"],\"birthDate\":\"1951-12-09\",\"gender\":\"male\",\"url\":\"https:\\\/\\\/www.actcom.dk\\\/da\\\/author\\\/admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"REST - REpresentational State Transfer - actcom","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.actcom.dk\/da\/rest-representational-state-transfer\/","og_locale":"da_DK","og_type":"article","og_title":"REST - REpresentational State Transfer","og_description":"Industrial communication based on standardized HTTP requests REST does not describe an actual protocol structure. Rather REST prescribes properties which should be met for data communication in industrial environments.","og_url":"https:\/\/www.actcom.dk\/da\/rest-representational-state-transfer\/","og_site_name":"actcom","article_published_time":"2022-04-26T14:07:54+00:00","author":"Jens - admin","twitter_card":"summary_large_image","twitter_misc":{"Skrevet af":"Jens - admin","Estimeret l\u00e6setid":"3 minutter"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.actcom.dk\/da\/rest-representational-state-transfer\/#article","isPartOf":{"@id":"https:\/\/www.actcom.dk\/da\/rest-representational-state-transfer\/"},"author":{"name":"Jens - admin","@id":"https:\/\/www.actcom.dk\/da\/#\/schema\/person\/a57fc9a95719d303e3ca50650d89fdeb"},"headline":"REST &#8211; REpresentational State Transfer","datePublished":"2022-04-26T14:07:54+00:00","mainEntityOfPage":{"@id":"https:\/\/www.actcom.dk\/da\/rest-representational-state-transfer\/"},"wordCount":598,"publisher":{"@id":"https:\/\/www.actcom.dk\/da\/#organization"},"articleSection":["Uncategorized"],"inLanguage":"da-DK"},{"@type":"WebPage","@id":"https:\/\/www.actcom.dk\/da\/rest-representational-state-transfer\/","url":"https:\/\/www.actcom.dk\/da\/rest-representational-state-transfer\/","name":"REST - REpresentational State Transfer - actcom","isPartOf":{"@id":"https:\/\/www.actcom.dk\/da\/#website"},"datePublished":"2022-04-26T14:07:54+00:00","breadcrumb":{"@id":"https:\/\/www.actcom.dk\/da\/rest-representational-state-transfer\/#breadcrumb"},"inLanguage":"da-DK","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.actcom.dk\/da\/rest-representational-state-transfer\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.actcom.dk\/da\/rest-representational-state-transfer\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.actcom.dk\/da\/"},{"@type":"ListItem","position":2,"name":"REST &#8211; REpresentational State Transfer"}]},{"@type":"WebSite","@id":"https:\/\/www.actcom.dk\/da\/#website","url":"https:\/\/www.actcom.dk\/da\/","name":"actcom","description":"","publisher":{"@id":"https:\/\/www.actcom.dk\/da\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.actcom.dk\/da\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"da-DK"},{"@type":"Organization","@id":"https:\/\/www.actcom.dk\/da\/#organization","name":"actcom","url":"https:\/\/www.actcom.dk\/da\/","logo":{"@type":"ImageObject","inLanguage":"da-DK","@id":"https:\/\/www.actcom.dk\/da\/#\/schema\/logo\/image\/","url":"https:\/\/www.actcom.dk\/wp-content\/uploads\/2023\/07\/atcomlogo.png","contentUrl":"https:\/\/www.actcom.dk\/wp-content\/uploads\/2023\/07\/atcomlogo.png","width":215,"height":68,"caption":"actcom"},"image":{"@id":"https:\/\/www.actcom.dk\/da\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.actcom.dk\/da\/#\/schema\/person\/a57fc9a95719d303e3ca50650d89fdeb","name":"Jens - admin","sameAs":["http:\/\/www.actcom.dk"],"birthDate":"1951-12-09","gender":"male","url":"https:\/\/www.actcom.dk\/da\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.actcom.dk\/da\/wp-json\/wp\/v2\/posts\/184173","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.actcom.dk\/da\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.actcom.dk\/da\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.actcom.dk\/da\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.actcom.dk\/da\/wp-json\/wp\/v2\/comments?post=184173"}],"version-history":[{"count":0,"href":"https:\/\/www.actcom.dk\/da\/wp-json\/wp\/v2\/posts\/184173\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.actcom.dk\/da\/wp-json\/wp\/v2\/media?parent=184173"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.actcom.dk\/da\/wp-json\/wp\/v2\/categories?post=184173"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.actcom.dk\/da\/wp-json\/wp\/v2\/tags?post=184173"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}