inet/zz_http_req.h

Go to the documentation of this file.
00001 /* libzzinet
00002  *
00003  * This program is distributed under the GNU General Public License, version 2.
00004  * A copy of this license is included with this source.
00005  *
00006  * Copyright 2000-2006, Toni Thomsson <toni@tonjac.org> 
00007 */
00008 
00009 #ifndef zz_http_req_h
00010 #define zz_http_req_h
00011 
00012 #include "zz_http_session.h"
00013 #include <zz_log.h>
00014 #include <zz_buffer.h>
00015 
00016 #include <config.h>
00017 #include <ne_session.h>
00018 #include <ne_request.h>
00019 
00020 #define CRLF char(13), char(10)
00021 
00027 class ZZ_API CzzHttpRequest
00028 {
00029 public:
00030 
00031         //* Construction
00032         CzzHttpRequest( CzzHttpSession* session, const char* method, const char* uri );
00033         virtual ~CzzHttpRequest();
00034 
00035         virtual int onBlockRead( const char *buf, size_t len );
00036         virtual int onAccept( int status );
00037 
00038         void addBody( const char *buf, size_t count );
00039         void addRequestHeader( const char* name, const char* value );
00040         void execute( void );
00041 
00042         CzzString getResponseHeader( const char* name );
00043         CzzBuffer* getReply( void );
00044 
00045 private:
00046 
00047         CzzLog m_Log;
00048         CzzBuffer m_Buffer;
00049         ne_request* m_Handle;
00050         CzzHttpSession* m_Session;
00051 
00052         static int reader( void *userdata, const char *buf, size_t len );
00053         static int accept( void *userdata, ne_request *req, const ne_status *st );
00054 };
00055 
00056 #endif // zz_http_req_h

Generated on Thu Sep 21 21:45:42 2006 for tonjac.org MINI/C++ library by  doxygen 1.4.6-NO