httpAccess.h
00001 #ifndef HTTP_ACCESS_H
00002 #define HTTP_ACCESS_H
00003
00004
00005
00006
00007
00008
00009
00010 #include "socketCtrl.h"
00011 #include "socketSet.h"
00012 #include <string>
00013
00014
00015 class HttpAccess {
00016 enum { TIMEOUT = 3000 };
00017 string server;
00018 int port;
00019 string items;
00020
00021 string sendRequest(SocketCtrl& socket,
00022 const char *request, int size, int timeout);
00023 HttpAccess(void);
00024
00025 public:
00026 HttpAccess(const char *web_server, int web_port);
00027 ~HttpAccess(void);
00028 string getHtmlText(const char *path, int timeout = TIMEOUT);
00029 HttpAccess& clearPutItem(void);
00030 HttpAccess& addPutItem(const char *title, const char *value);
00031 string sendPutItem(const char *path, int timeout = TIMEOUT);
00032 };
00033
00034 #endif
00035