Got modem to work with MedSentry website. Includes minor change to a library file.
Fork of HTTPClient-SSL by
data/HTTPJson.h@29:2d96cc752d19, 2014-08-27 (annotated)
- Committer:
- ansond
- Date:
- Wed Aug 27 20:30:29 2014 +0000
- Revision:
- 29:2d96cc752d19
added HTTPJson data type and created defines for increased url lengths
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ansond | 29:2d96cc752d19 | 1 | /* HTTPJson.h */ |
ansond | 29:2d96cc752d19 | 2 | /* Copyright (C) 2012 mbed.org, MIT License |
ansond | 29:2d96cc752d19 | 3 | * |
ansond | 29:2d96cc752d19 | 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software |
ansond | 29:2d96cc752d19 | 5 | * and associated documentation files (the "Software"), to deal in the Software without restriction, |
ansond | 29:2d96cc752d19 | 6 | * including without limitation the rights to use, copy, modify, merge, publish, distribute, |
ansond | 29:2d96cc752d19 | 7 | * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is |
ansond | 29:2d96cc752d19 | 8 | * furnished to do so, subject to the following conditions: |
ansond | 29:2d96cc752d19 | 9 | * |
ansond | 29:2d96cc752d19 | 10 | * The above copyright notice and this permission notice shall be included in all copies or |
ansond | 29:2d96cc752d19 | 11 | * substantial portions of the Software. |
ansond | 29:2d96cc752d19 | 12 | * |
ansond | 29:2d96cc752d19 | 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING |
ansond | 29:2d96cc752d19 | 14 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
ansond | 29:2d96cc752d19 | 15 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
ansond | 29:2d96cc752d19 | 16 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
ansond | 29:2d96cc752d19 | 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
ansond | 29:2d96cc752d19 | 18 | */ |
ansond | 29:2d96cc752d19 | 19 | |
ansond | 29:2d96cc752d19 | 20 | |
ansond | 29:2d96cc752d19 | 21 | #ifndef HTTPJSON_H_ |
ansond | 29:2d96cc752d19 | 22 | #define HTTPJSON_H_ |
ansond | 29:2d96cc752d19 | 23 | |
ansond | 29:2d96cc752d19 | 24 | #include "HTTPText.h" |
ansond | 29:2d96cc752d19 | 25 | |
ansond | 29:2d96cc752d19 | 26 | /** A data endpoint to store JSON text |
ansond | 29:2d96cc752d19 | 27 | */ |
ansond | 29:2d96cc752d19 | 28 | class HTTPJson : public HTTPText |
ansond | 29:2d96cc752d19 | 29 | { |
ansond | 29:2d96cc752d19 | 30 | public: |
ansond | 29:2d96cc752d19 | 31 | /** Create an HTTPJson instance for output |
ansond | 29:2d96cc752d19 | 32 | * @param json_str JSON string to be transmitted |
ansond | 29:2d96cc752d19 | 33 | */ |
ansond | 29:2d96cc752d19 | 34 | HTTPJson(char* json_str); |
ansond | 29:2d96cc752d19 | 35 | |
ansond | 29:2d96cc752d19 | 36 | /** Create an HTTPText instance for input |
ansond | 29:2d96cc752d19 | 37 | * @param json_str Buffer to store the incoming JSON string |
ansond | 29:2d96cc752d19 | 38 | * @param size Size of the buffer |
ansond | 29:2d96cc752d19 | 39 | */ |
ansond | 29:2d96cc752d19 | 40 | HTTPJson(char* json_str, size_t size); |
ansond | 29:2d96cc752d19 | 41 | |
ansond | 29:2d96cc752d19 | 42 | protected: |
ansond | 29:2d96cc752d19 | 43 | virtual int getDataType(char* type, size_t maxTypeLen); //Internet media type for Content-Type header |
ansond | 29:2d96cc752d19 | 44 | }; |
ansond | 29:2d96cc752d19 | 45 | |
ansond | 29:2d96cc752d19 | 46 | #endif /* HTTPJSON_H_ */ |