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.
Dependents: HTTPSClientExample
Revision 3:18af58231990, committed 2013-09-12
- Comitter:
- feb11
- Date:
- Thu Sep 12 09:05:02 2013 +0000
- Parent:
- 2:6d7bc51cc77b
- Commit message:
- fixed scanf status line
Changed in this revision
| HTTPHeader.cpp | Show annotated file Show diff for this revision Revisions of this file |
| HTTPSClient.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/HTTPHeader.cpp Thu Sep 05 14:28:29 2013 +0000
+++ b/HTTPHeader.cpp Thu Sep 12 09:05:02 2013 +0000
@@ -8,14 +8,14 @@
std::string HTTPHeader::getRequest(const std::string &path, const std::string &host, const int port)
{
+
std::string request = "GET ";
request += path;
- request += " HTTP/1.1\r\nHost: ";
+ request += " HTTP/1.0\r\nHost: ";
request += host;
request += ":";
request += port;
request += "\r\n\r\n";
-
return request;
}
--- a/HTTPSClient.cpp Thu Sep 05 14:28:29 2013 +0000
+++ b/HTTPSClient.cpp Thu Sep 12 09:05:02 2013 +0000
@@ -33,7 +33,7 @@
{
HTTPHeader hdr;
std::string line = readLine();
- sscanf(line.c_str(), "HTTP/1.1 %d OK", &hdr._status);
+ sscanf(line.c_str(), "HTTP/1.%*d %d OK", &hdr._status);
do {
if(!line.compare(0,strlen("Content-Length"), "Content-Length"))
sscanf(line.c_str(), "Content-Length: %d", &hdr._bodyLength);