A Port of TI's Webserver for the CC3000

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers HttpRequest.h Source File

HttpRequest.h

00001 /*****************************************************************************
00002 *
00003 *  HttpRequest.h
00004 *  Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
00005 *
00006 *  Redistribution and use in source and binary forms, with or without
00007 *  modification, are permitted provided that the following conditions
00008 *  are met:
00009 *
00010 *    Redistributions of source code must retain the above copyright
00011 *    notice, this list of conditions and the following disclaimer.
00012 *
00013 *    Redistributions in binary form must reproduce the above copyright
00014 *    notice, this list of conditions and the following disclaimer in the
00015 *    documentation and/or other materials provided with the   
00016 *    distribution.
00017 *
00018 *    Neither the name of Texas Instruments Incorporated nor the names of
00019 *    its contributors may be used to endorse or promote products derived
00020 *    from this software without specific prior written permission.
00021 *
00022 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
00023 *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
00024 *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00025 *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
00026 *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
00027 *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
00028 *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00029 *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00030 *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
00031 *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
00032 *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00033 *
00034 *****************************************************************************/
00035 #ifndef _HTTP_REQUEST_H_
00036 #define _HTTP_REQUEST_H_
00037 
00038 /** 
00039  * @defgroup HttpRequest HTTP Request definitions
00040  * This header file defines the structure which holds information about an HTTP request.
00041  * Such a structure is generated by the core module and then passed to a content handler module for processing.
00042  *
00043  * @{
00044  */
00045 
00046 #include "Common.h"
00047 #include "HttpString.h"
00048 
00049 /// The client wishes to close the connection after this request
00050 #define HTTP_REQUEST_FLAG_CLOSE          (1 << 0)
00051 /// The client accepts gzip-compressed content
00052 #define HTTP_REQUEST_FLAG_ACCEPT_GZIP    (1 << 1)
00053 /// The request is POST. Otherwise it's GET.
00054 #define HTTP_REQUEST_FLAG_METHOD_POST    (1 << 2)
00055 /// The request was authenticated correctly
00056 #define HTTP_REQUEST_FLAG_AUTHENTICATED  (1 << 3)
00057 /// The request uses HTTP/1.1 otherwise HTTP/1.0
00058 #define HTTP_REQUEST_1_1                 (1 << 4)
00059 /// The request containes content, longer than supported
00060 #define HTTP_REQUEST_CONTENT_IGNORED     (1 << 5)
00061 
00062 
00063 /**
00064  * A structure to hold all data about an HTTP request
00065  * Note: The request's resource string is not passed as part of this structure, but rather directly to the Http*_InitRequest() function
00066  */
00067 struct HttpRequest
00068 {
00069     /// Flags. See HTTP_REQUEST_FLAG_*
00070     uint16 uFlags;
00071     /// Connection number in HttpCore. This value is guaranteed to satisfy: 0 <= uConnection < HTTP_CORE_MAX_CONNECTIONS
00072     uint16 uConnection;
00073     /// Request content information (e.g. POST data). uLength value of 0 indicates no content was sent in the request.
00074     struct HttpBlob requestContent;
00075 };
00076 
00077 /// @}
00078 
00079 #endif //_HTTP_REQUEST_H_
00080