Http client library.

Fork of HTTPClient by Toyomasa Watarai

Revision:
20:a0201b94b774
Parent:
19:3c7789c521df
diff -r 3c7789c521df -r a0201b94b774 HTTPClient.cpp
--- a/HTTPClient.cpp	Fri Jan 23 09:55:35 2015 +0000
+++ b/HTTPClient.cpp	Mon Mar 16 11:30:54 2015 +0000
@@ -18,7 +18,7 @@
  */
 
 //Debug is disabled by default
-#if 0
+#if 1
 //Enable debug
 #include <cstdio>
 #define DBG(x, ...) std::printf("[HTTPClient : DBG]"x"\r\n", ##__VA_ARGS__); 
@@ -161,7 +161,8 @@
   DBG("Sending request");
   char buf[CHUNK_SIZE];
   const char* meth = (method==HTTP_GET)?"GET":(method==HTTP_POST)?"POST":(method==HTTP_PUT)?"PUT":(method==HTTP_DELETE)?"DELETE":"";
-  snprintf(buf, sizeof(buf), "%s %s HTTP/1.1\r\nHost: %s\r\n", meth, path, host); //Write request
+  snprintf(buf, sizeof(buf), "%s %s HTTP/1.1\r\nHost: %s:%d\r\n", meth, path, host ,port); //Write request
+  DBG("Request line: buf.");
   ret = send(buf);
   if(ret)
   {