00001 /* 00002 * $Id$ 00003 * 00004 * X-VR2 00005 * 00006 * Copyright (C) Juan V. Guerrero 2007 00007 * 00008 * Juan V. Guerrero <mindstorm2600@users.sourceforge.net> 00009 * 00010 * This program is free software, distributed under the terms of 00011 * the GNU General Public License Version 2. See the LICENSE file 00012 * at the top of the source tree. 00013 */ 00014 #ifndef __XVR2_NET_HTTP_CLIENT_H__ 00015 #define __XVR2_NET_HTTP_CLIENT_H__ 00016 #include<xvr2/String.h> 00017 #include<xvr2/Net/TCPSocket.h> 00018 #include<xvr2/Net/HTTPResponse.h> 00019 00020 namespace xvr2 { 00021 namespace Net { 00025 class HTTPClient : public TCPSocket { 00026 private: 00027 protected: 00028 String url; 00029 String uagent; 00030 public: 00031 HTTPClient(); 00032 HTTPClient(const String &_url); 00033 HTTPClient(const String &_url, const String &user_agent); 00034 static HTTPClient create(const String &url); 00035 static void mGet(const String &url, HTTPResponse &resp); 00036 void mGet(HTTPResponse &resp); 00037 void mPut(HTTPResponse &resp); 00038 void mPost(HTTPResponse &resp); 00039 void mDelete(HTTPResponse &resp); 00040 void runMethod(const String &method_name, const String &url, HTTPResponse &resp); 00041 }; 00042 } 00043 } 00044 00045 00046 #endif