
Example program demonstrating use of HTTP or HTTPS protocol over a cellular connection with httpbin.org using the MTSAS library. (Demonstrates GET,POST,basic-auth)
Revision 1:7a2c5889a55d, committed 2014-07-24
- Comitter:
- Vanger
- Date:
- Thu Jul 24 20:03:05 2014 +0000
- Parent:
- 0:0be90fca1622
- Child:
- 2:e20a75d47720
- Commit message:
- Tweaked output to be easier to distinguish
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Jul 24 19:10:18 2014 +0000 +++ b/main.cpp Thu Jul 24 20:03:05 2014 +0000 @@ -41,8 +41,7 @@ io->baud(115200); Cellular* radio = CellularFactory::create(io); - radio->setApn(APN); - wait(10); + radio->setApn(APN); //Establish PPP link radio->connect(); @@ -52,11 +51,11 @@ //Send HTTP request radio->write(RequestLine, sizeof(RequestLine), 2000); - printf("HTTP Request sent:[%s]\n",RequestLine); + printf("HTTP Request sent:\n\n%s\n\n",RequestLine); //Read HTTP response from server radio->read(read_response, 4097, 2000); - printf("HTTP Response read:[%s]\n", read_response); + printf("HTTP Response read:\n\n%s\n\n", read_response); //Disconnect PPP link radio->disconnect();