A place users can post their projects. If you have a small project and would like your own dedicated place to post and have others chat about it then this is your spot.

User avatar
By jeny
#24764
Code: Select allString url = "http://pubsub.pubnub.com/publish/demo/demo/0/rkgtest/0/%22Hello%20World%22";
 
  Serial.print("Requesting URL: ");
  Serial.println(url);
 
  // This will send the request to the serveg
  client.print(String("GET ") + url  + " HTTP/1.1\r\n" +
               "Host: " + host + "\r\n" +
               "Connection: Keep-Alive\r\n\r\n");
  delay(10);
 


i am trying this for publish hello to demo channel, but response on serial interface is:-
.....
WiFi connected
IP address:
192.168.1.5
connecting to http://pubsub.pubnub.com
Requesting URL: http://pubsub.pubnub.com/publish/demo/d ... 20World%22
HTTP/1.1 400 Bad Request
Server: nginx
Date: Sat, 01 Aug 2015 12:53:24 GMT
Content-Type: text/html
Content-Length: 166
Connection: close

<html>
<head><title>400 Bad Request</title></head>
<body bgcolor="white">
<center><h1>400 Bad Request</h1></center>
<hr><center>nginx</center>
</body>
</html>

closing connection
User avatar
By pvvx
#24767 What is it "HTTP/1.1 400 Bad Request" ? -> 406 or 418.
Hyper Text Coffee Pot Control Protocol (HTCPCP/1.0) - RFC 2324,
http://www.rfc-editor.org/rfc/rfc2324.txt
RFC 7168 extended HTCPCP to fully handle teapots...

https://en.wikipedia.org/wiki/Hyper_Tex ... l_Protocol
Arduino not support HTCPCP :?:
https://github.com/pvvx/esp8266web/blob ... srv.c#L137