Thread Rating:
  • 2 Vote(s) - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5

[Pro2 Plus RX] Integrating RESTful Sensor Data - working solution for local wifi/www
#14

If we want to use a concatenated String variable (let's assume: "WD-"+X) as Hostname, than we can use these two assignments:

if (wifi.createTCP(mux_id, "WD-"+String(variableX), 80, 0)) {

String s_VariableX = String(variableX);
char *prefix = "GET / HTTP/1.1\r\nHost: WD-";
char *postfix =" host:80\r\nConnection: close\r\n\r\n"; 
String url = prefix +s_VariableX+ postfix;
const char *get_json = url.c_str(); //this whole thing can be done once as init also... --> then I think we can save microcontroller cycles!


I hope this helps you a bit for convincing to switch to hostnames Wink
Reply


Messages In This Thread
[Pro2 Plus RX] Integrating RESTful Sensor Data - working solution for local wifi/www - by t3gathome - 04-06-2018, 23:36
RE: [Pro2 Plus RX] Integrating RESTful Sensor Data - working solution for local wifi/www - by werk_ag - 05-06-2018, 22:12
RE: [Pro2 Plus RX] Integrating RESTful Sensor Data - working solution for local wifi/www - by t3gathome - 05-06-2018, 22:24
RE: [Pro2 Plus RX] Integrating RESTful Sensor Data - working solution for local wifi/www - by t3gathome - 05-06-2018, 22:36
RE: [Pro2 Plus RX] Integrating RESTful Sensor Data - working solution for local wifi/www - by werk_ag - 05-06-2018, 22:49
RE: [Pro2 Plus RX] Integrating RESTful Sensor Data - working solution for local wifi/www - by werk_ag - 05-06-2018, 22:41
RE: [Pro2 Plus RX] Integrating RESTful Sensor Data - working solution for local wifi/www - by t3gathome - 06-06-2018, 20:34
RE: [Pro2 Plus RX] Integrating RESTful Sensor Data - working solution for local wifi/www - by werk_ag - 07-06-2018, 03:23
RE: [Pro2 Plus RX] Integrating RESTful Sensor Data - working solution for local wifi/www - by markkkk42 - 07-06-2018, 06:26
RE: [Pro2 Plus RX] Integrating RESTful Sensor Data - working solution for local wifi/www - by werk_ag - 07-06-2018, 19:19
RE: [Pro2 Plus RX] Integrating RESTful Sensor Data - working solution for local wifi/www - by t3gathome - 07-06-2018, 21:03
RE: [Pro2 Plus RX] Integrating RESTful Sensor Data - working solution for local wifi/www - by werk_ag - 08-06-2018, 03:15
RE: [Pro2 Plus RX] Integrating RESTful Sensor Data - working solution for local wifi/www - by t3gathome - 08-06-2018, 20:37
RE: [Pro2 Plus RX] Integrating RESTful Sensor Data - working solution for local wifi/www - by t3gathome - 08-06-2018, 22:05
RE: [Pro2 Plus RX] Integrating RESTful Sensor Data - working solution for local wifi/www - by werk_ag - 09-06-2018, 02:16
RE: [Pro2 Plus RX] Integrating RESTful Sensor Data - working solution for local wifi/www - by engolling - 10-06-2018, 22:04
RE: [Pro2 Plus RX] Integrating RESTful Sensor Data - working solution for local wifi/www - by werk_ag - 12-06-2018, 21:59
RE: [Pro2 Plus RX] Integrating RESTful Sensor Data - working solution for local wifi/www - by engolling - 13-06-2018, 20:52
RE: [Pro2 Plus RX] Integrating RESTful Sensor Data - working solution for local wifi/www - by t3gathome - 11-06-2018, 00:56
RE: [Pro2 Plus RX] Integrating RESTful Sensor Data - working solution for local wifi/www - by werk_ag - 12-06-2018, 22:10
RE: [Pro2 Plus RX] Integrating RESTful Sensor Data - working solution for local wifi/www - by t3gathome - 12-06-2018, 22:17
RE: [Pro2 Plus RX] Integrating RESTful Sensor Data - working solution for local wifi/www - by werk_ag - 12-06-2018, 22:33
RE: [Pro2 Plus RX] Integrating RESTful Sensor Data - working solution for local wifi/www - by t3gathome - 13-06-2018, 23:32
RE: [Pro2 Plus RX] Integrating RESTful Sensor Data - working solution for local wifi/www - by t3gathome - 13-06-2018, 23:37
RE: [Pro2 Plus RX] Integrating RESTful Sensor Data - working solution for local wifi/www - by t3gathome - 14-06-2018, 01:22
RE: [Pro2 Plus RX] Integrating RESTful Sensor Data - working solution for local wifi/www - by werk_ag - 25-06-2018, 17:16
RE: [Pro2 Plus RX] Integrating RESTful Sensor Data - working solution for local wifi/www - by t3gathome - 25-06-2018, 23:24
RE: [Pro2 Plus RX] Integrating RESTful Sensor Data - working solution for local wifi/www - by t3gathome - 20-06-2018, 22:27
RE: [Pro2 Plus RX] Integrating RESTful Sensor Data - working solution for local wifi/www - by werk_ag - 01-07-2018, 19:36
RE: [Pro2 Plus RX] Integrating RESTful Sensor Data - working solution for local wifi/www - by werk_ag - 25-06-2018, 17:10
RE: [Pro2 Plus RX] Integrating RESTful Sensor Data - working solution for local wifi/www - by t3gathome - 03-07-2018, 15:41
RE: [Pro2 Plus RX] Integrating RESTful Sensor Data - working solution for local wifi/www - by werk_ag - 04-07-2018, 22:54
RE: [Pro2 Plus RX] Integrating RESTful Sensor Data - working solution for local wifi/www - by t3gathome - 08-07-2018, 21:02
RE: [Pro2 Plus RX] Integrating RESTful Sensor Data - working solution for local wifi/www - by werk_ag - 08-07-2018, 23:17
RE: [Pro2 Plus RX] Integrating RESTful Sensor Data - working solution for local wifi/www - by uncle_bob - 09-07-2018, 08:56
RE: [Pro2 Plus RX] Integrating RESTful Sensor Data - working solution for local wifi/www - by hornychz - 08-07-2018, 23:40



Users browsing this thread: 1 Guest(s)