]>
git.gir.st - tmk_keyboard.git/blob - tool/mbed/mbed-sdk/libraries/tests/net/cellular/http/common/HTTPClient/data/HTTPMap.h
2 /* Copyright (C) 2012 mbed.org, MIT License
4 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
5 * and associated documentation files (the "Software"), to deal in the Software without restriction,
6 * including without limitation the rights to use, copy, modify, merge, publish, distribute,
7 * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
8 * furnished to do so, subject to the following conditions:
10 * The above copyright notice and this permission notice shall be included in all copies or
11 * substantial portions of the Software.
13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
14 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
15 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
16 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 #include "../IHTTPData.h"
26 #define HTTPMAP_TABLE_SIZE 32
28 /** Map of key/value pairs
29 * Used to transmit POST data using the application/x-www-form-urlencoded encoding
31 class HTTPMap
: public IHTTPDataOut
36 It supports at most 32 key/values pairs
40 /** Put Key/Value pair
41 The references to the parameters must remain valid as long as the clear() function is not called
42 @param key The key to use
43 @param value The corresponding value
45 void put(const char* key
, const char* value
);
53 virtual void readReset();
55 virtual int read(char* buf
, size_t len
, size_t* pReadLen
);
57 virtual int getDataType(char* type
, size_t maxTypeLen
); //Internet media type for Content-Type header
59 virtual bool getIsChunked(); //For Transfer-Encoding header
61 virtual size_t getDataLen(); //For Content-Length header
64 const char* m_keys
[HTTPMAP_TABLE_SIZE
];
65 const char* m_values
[HTTPMAP_TABLE_SIZE
];
71 #endif /* HTTPMAP_H_ */