00001 /**************************************************************** 00002 * Vidalia is distributed under the following license: 00003 * 00004 * Copyright (C) 2006, Matt Edman, Justin Hipple 00005 * 00006 * This program is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU General Public License 00008 * as published by the Free Software Foundation; either version 2 00009 * of the License, or (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 * Boston, MA 02110-1301, USA. 00020 ****************************************************************/ 00021 00022 /** 00023 * \file http.h 00024 * \version $Id: http.h 1238 2006-09-25 17:50:57Z edmanm $ 00025 * \brief Simple HTTP GET request object 00026 */ 00027 00028 #ifndef _HTTP_H 00029 #define _HTTP_H 00030 00031 #include <QHttp> 00032 00033 00034 class Http : private QHttp 00035 { 00036 Q_OBJECT 00037 00038 public: 00039 /** Constructor */ 00040 Http(QString host, quint16 port = 80); 00041 00042 /** Requests the given file from the specified host. */ 00043 bool request(QString path); 00044 /** Returns the body of the HTML response. */ 00045 QString body(); 00046 00047 private: 00048 /** Contains the HTTP server's response after a successful request */ 00049 QByteArray _response; 00050 }; 00051 00052 #endif 00053