| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <?php
-
-
- //
- // !list
- //
- $dictResponse = array();
- $dictResponse["success"] = false;
- $dictResponse["status_code"] = 400;
- $dictResponse["status_description"] = "parameter missing";
-
- //
- // main - no interface
- //
- if ( !isset($_REQUEST["interface"]) || $_REQUEST["interface"] == "" ) {
-
- //
- $dictResponse = array();
- $dictResponse["success"] = true;
- $dictResponse["status_code"] = 200;
- $dictResponse["status_description"] = "ok";
-
- $data = "<b>Hello world!</b><br>
- weather information ;-)<br>
- <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"currentColor\" class=\"bi bi-cloud-drizzle\" viewBox=\"0 0 16 16\">
- <path d=\"M4.158 12.025a.5.5 0 0 1 .316.633l-.5 1.5a.5.5 0 0 1-.948-.316l.5-1.5a.5.5 0 0 1 .632-.317m6 0a.5.5 0 0 1 .316.633l-.5 1.5a.5.5 0 0 1-.948-.316l.5-1.5a.5.5 0 0 1 .632-.317m-3.5 1.5a.5.5 0 0 1 .316.633l-.5 1.5a.5.5 0 0 1-.948-.316l.5-1.5a.5.5 0 0 1 .632-.317m6 0a.5.5 0 0 1 .316.633l-.5 1.5a.5.5 0 1 1-.948-.316l.5-1.5a.5.5 0 0 1 .632-.317m.747-8.498a5.001 5.001 0 0 0-9.499-1.004A3.5 3.5 0 1 0 3.5 11H13a3 3 0 0 0 .405-5.973M8.5 2a4 4 0 0 1 3.976 3.555.5.5 0 0 0 .5.445H13a2 2 0 0 1 0 4H3.5a2.5 2.5 0 1 1 .605-4.926.5.5 0 0 0 .596-.329A4 4 0 0 1 8.5 2\"/>
- </svg>
- ";
-
- $dictResponse["response"] = "".$data;
-
- }
-
- //
- // interface: dev
- //
- if ( isset($_REQUEST["interface"]) && $_REQUEST["interface"] == "dev" ) {
- //echo "<pre>"; print_r($_REQUEST); echo "</pre>";
-
- //
- $dictResponse = array();
- $dictResponse["success"] = true;
- $dictResponse["status_code"] = 200;
- $dictResponse["status_description"] = "ok";
-
- //
- $arrEntries = array();
-
- $dictEntry = array();
- $dictEntry["id"] = "1";
- $dictEntry["name"] = "name 1";
- $arrEntries[] = $dictEntry;
-
- $dictEntry = array();
- $dictEntry["id"] = "2";
- $dictEntry["name"] = "name 2";
- $arrEntries[] = $dictEntry;
-
- //
- $dictResponse["entries"] = $arrEntries;
- }
-
-
-
-
-
- // JSON_HEX_APOS ???
- $output = json_encode($dictResponse, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
-
- //
- header('Content-Type: application/json');
- http_response_code($dictResponse["status_code"]);
- echo $output;
-
- //
- exit;
- ?>
|