From 54ef2750aef0c64df56daff50af7719f85017c33 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 2 Nov 2006 08:49:42 +0000 Subject: Moved HttpGet in from eubit. It's pretty cool, just give it a url, and it gives you a Stream contianing the web server's response. Right now it doesn't parse any headers or anything. --- src/httpget.h | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/httpget.h (limited to 'src/httpget.h') diff --git a/src/httpget.h b/src/httpget.h new file mode 100644 index 0000000..afa1ec5 --- /dev/null +++ b/src/httpget.h @@ -0,0 +1,44 @@ +#ifndef HTTP_GET_H +#define HTTP_GET_H + +#include +#include +#include +#include + +#include "sbuffer.h" + +class HttpGet +{ +public: + HttpGet(); + HttpGet( const std::string &url ); + virtual ~HttpGet(); + + void setURL( const std::string &url ); + void addParam( const std::string &key, const std::string &value ); + void setUserAgent( const std::string &sUserAgent ) + { + this->sUserAgent = sUserAgent; + } + void setHost( const std::string &sHost ) + { + this->sHost = sHost; + } + + std::string escape( const std::string &src ); + SBuffer *get(); + +private: + std::string sProto; + std::string sHost; + std::string sPath; + std::string sUserAgent; + typedef std::pair StringPair; + std::list lParams; + int nPort; + static char hexcode[]; + +}; + +#endif -- cgit v1.2.3