File modules/cms/generator/dsl/DslHttp.class.php

Last commit: Mon Jun 27 00:40:42 2022 +0200	Jan Dankert	New: Marker interface 'Scriptable', Proxy class for MQTT, help() method in Scripts.
1 <?php 2 3 namespace cms\generator\dsl; 4 5 use dsl\context\BaseScriptableObject; 6 use dsl\context\Scriptable; 7 use util\Http; 8 use util\json\JSON; 9 10 class DslHttp extends BaseScriptableObject 11 { 12 public function get( $url ) 13 { 14 return $this->request('GET', $url ); 15 } 16 17 public function post($url ) 18 { 19 return $this->request('POST', $url ); 20 } 21 22 private function request($method, $url ) { 23 $http = new Http( $url ); 24 $http->method = $method; 25 $http->request(); 26 return $http->body; 27 } 28 }
Download modules/cms/generator/dsl/DslHttp.class.php
History Mon, 27 Jun 2022 00:40:42 +0200 Jan Dankert New: Marker interface 'Scriptable', Proxy class for MQTT, help() method in Scripts. Tue, 31 May 2022 00:32:27 +0200 Jan Dankert New: More context objects for the DSL