Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of HTTPClient by
Revision 20:a0201b94b774, committed 2015-03-16
- Comitter:
- nayuta
- Date:
- Mon Mar 16 11:30:54 2015 +0000
- Parent:
- 19:3c7789c521df
- Commit message:
- Fix bug: Add port number to host field of http request header.
Changed in this revision
| HTTPClient.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- 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)
{
