A Port of TI's Webserver for the CC3000
WebServer/HttpRequest.h@2:e6a185df9e4c, 2013-09-16 (annotated)
- Committer:
- dflet
- Date:
- Mon Sep 16 18:37:14 2013 +0000
- Revision:
- 2:e6a185df9e4c
- Parent:
- 0:6ad60d78b315
ADC and Leds now work on board and config.html page.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| dflet | 0:6ad60d78b315 | 1 | /***************************************************************************** |
| dflet | 0:6ad60d78b315 | 2 | * |
| dflet | 0:6ad60d78b315 | 3 | * HttpRequest.h |
| dflet | 0:6ad60d78b315 | 4 | * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ |
| dflet | 0:6ad60d78b315 | 5 | * |
| dflet | 0:6ad60d78b315 | 6 | * Redistribution and use in source and binary forms, with or without |
| dflet | 0:6ad60d78b315 | 7 | * modification, are permitted provided that the following conditions |
| dflet | 0:6ad60d78b315 | 8 | * are met: |
| dflet | 0:6ad60d78b315 | 9 | * |
| dflet | 0:6ad60d78b315 | 10 | * Redistributions of source code must retain the above copyright |
| dflet | 0:6ad60d78b315 | 11 | * notice, this list of conditions and the following disclaimer. |
| dflet | 0:6ad60d78b315 | 12 | * |
| dflet | 0:6ad60d78b315 | 13 | * Redistributions in binary form must reproduce the above copyright |
| dflet | 0:6ad60d78b315 | 14 | * notice, this list of conditions and the following disclaimer in the |
| dflet | 0:6ad60d78b315 | 15 | * documentation and/or other materials provided with the |
| dflet | 0:6ad60d78b315 | 16 | * distribution. |
| dflet | 0:6ad60d78b315 | 17 | * |
| dflet | 0:6ad60d78b315 | 18 | * Neither the name of Texas Instruments Incorporated nor the names of |
| dflet | 0:6ad60d78b315 | 19 | * its contributors may be used to endorse or promote products derived |
| dflet | 0:6ad60d78b315 | 20 | * from this software without specific prior written permission. |
| dflet | 0:6ad60d78b315 | 21 | * |
| dflet | 0:6ad60d78b315 | 22 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| dflet | 0:6ad60d78b315 | 23 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| dflet | 0:6ad60d78b315 | 24 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| dflet | 0:6ad60d78b315 | 25 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| dflet | 0:6ad60d78b315 | 26 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| dflet | 0:6ad60d78b315 | 27 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| dflet | 0:6ad60d78b315 | 28 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| dflet | 0:6ad60d78b315 | 29 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| dflet | 0:6ad60d78b315 | 30 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| dflet | 0:6ad60d78b315 | 31 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| dflet | 0:6ad60d78b315 | 32 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| dflet | 0:6ad60d78b315 | 33 | * |
| dflet | 0:6ad60d78b315 | 34 | *****************************************************************************/ |
| dflet | 0:6ad60d78b315 | 35 | #ifndef _HTTP_REQUEST_H_ |
| dflet | 0:6ad60d78b315 | 36 | #define _HTTP_REQUEST_H_ |
| dflet | 0:6ad60d78b315 | 37 | |
| dflet | 0:6ad60d78b315 | 38 | /** |
| dflet | 0:6ad60d78b315 | 39 | * @defgroup HttpRequest HTTP Request definitions |
| dflet | 0:6ad60d78b315 | 40 | * This header file defines the structure which holds information about an HTTP request. |
| dflet | 0:6ad60d78b315 | 41 | * Such a structure is generated by the core module and then passed to a content handler module for processing. |
| dflet | 0:6ad60d78b315 | 42 | * |
| dflet | 0:6ad60d78b315 | 43 | * @{ |
| dflet | 0:6ad60d78b315 | 44 | */ |
| dflet | 0:6ad60d78b315 | 45 | |
| dflet | 0:6ad60d78b315 | 46 | #include "Common.h" |
| dflet | 0:6ad60d78b315 | 47 | #include "HttpString.h" |
| dflet | 0:6ad60d78b315 | 48 | |
| dflet | 0:6ad60d78b315 | 49 | /// The client wishes to close the connection after this request |
| dflet | 0:6ad60d78b315 | 50 | #define HTTP_REQUEST_FLAG_CLOSE (1 << 0) |
| dflet | 0:6ad60d78b315 | 51 | /// The client accepts gzip-compressed content |
| dflet | 0:6ad60d78b315 | 52 | #define HTTP_REQUEST_FLAG_ACCEPT_GZIP (1 << 1) |
| dflet | 0:6ad60d78b315 | 53 | /// The request is POST. Otherwise it's GET. |
| dflet | 0:6ad60d78b315 | 54 | #define HTTP_REQUEST_FLAG_METHOD_POST (1 << 2) |
| dflet | 0:6ad60d78b315 | 55 | /// The request was authenticated correctly |
| dflet | 0:6ad60d78b315 | 56 | #define HTTP_REQUEST_FLAG_AUTHENTICATED (1 << 3) |
| dflet | 0:6ad60d78b315 | 57 | /// The request uses HTTP/1.1 otherwise HTTP/1.0 |
| dflet | 0:6ad60d78b315 | 58 | #define HTTP_REQUEST_1_1 (1 << 4) |
| dflet | 0:6ad60d78b315 | 59 | /// The request containes content, longer than supported |
| dflet | 0:6ad60d78b315 | 60 | #define HTTP_REQUEST_CONTENT_IGNORED (1 << 5) |
| dflet | 0:6ad60d78b315 | 61 | |
| dflet | 0:6ad60d78b315 | 62 | |
| dflet | 0:6ad60d78b315 | 63 | /** |
| dflet | 0:6ad60d78b315 | 64 | * A structure to hold all data about an HTTP request |
| dflet | 0:6ad60d78b315 | 65 | * Note: The request's resource string is not passed as part of this structure, but rather directly to the Http*_InitRequest() function |
| dflet | 0:6ad60d78b315 | 66 | */ |
| dflet | 0:6ad60d78b315 | 67 | struct HttpRequest |
| dflet | 0:6ad60d78b315 | 68 | { |
| dflet | 0:6ad60d78b315 | 69 | /// Flags. See HTTP_REQUEST_FLAG_* |
| dflet | 0:6ad60d78b315 | 70 | uint16 uFlags; |
| dflet | 0:6ad60d78b315 | 71 | /// Connection number in HttpCore. This value is guaranteed to satisfy: 0 <= uConnection < HTTP_CORE_MAX_CONNECTIONS |
| dflet | 0:6ad60d78b315 | 72 | uint16 uConnection; |
| dflet | 0:6ad60d78b315 | 73 | /// Request content information (e.g. POST data). uLength value of 0 indicates no content was sent in the request. |
| dflet | 0:6ad60d78b315 | 74 | struct HttpBlob requestContent; |
| dflet | 0:6ad60d78b315 | 75 | }; |
| dflet | 0:6ad60d78b315 | 76 | |
| dflet | 0:6ad60d78b315 | 77 | /// @} |
| dflet | 0:6ad60d78b315 | 78 | |
| dflet | 0:6ad60d78b315 | 79 | #endif //_HTTP_REQUEST_H_ |
| dflet | 0:6ad60d78b315 | 80 |