/[winpt]/trunk/Include/wptHTTP.h
ViewVC logotype

Diff of /trunk/Include/wptHTTP.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 200 by twoaday, Mon Apr 17 09:12:50 2006 UTC revision 312 by twoaday, Sun May 13 09:43:33 2007 UTC
# Line 1  Line 1 
1  /* wptHttp.h - Generic HTTP code  /* wptHTTP.h - Generic network code for HTTP access
2   *      Copyright (C) 2004, 2005, 2006 Timo Schulz   *      Copyright (C) 2004, 2005, 2006, 2007 Timo Schulz
3   *   *
4   * This file is part of WinPT.   * This file is part of WinPT.
5   *   *
# Line 12  Line 12 
12   * but WITHOUT ANY WARRANTY; without even the implied warranty of   * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14   * General Public License for more details.   * General Public License for more details.
  *  
  * You should have received a copy of the GNU General Public License  
  * along with WinPT; if not, write to the Free Software Foundation,  
  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA  
15   */   */
   
16  #ifndef WPT_HTTP_H  #ifndef WPT_HTTP_H
17  #define WPT_HTTP_H  #define WPT_HTTP_H
18    
# Line 38  enum http_statcode_t { Line 33  enum http_statcode_t {
33    
34  /* HTTP header list. */  /* HTTP header list. */
35  struct http_head_s {  struct http_head_s {
36      struct http_head_s * next;      struct http_head_s *next;
     int flags;  
37      char d[1];      char d[1];
38  };  };
39  typedef struct http_head_s *http_head_t;  typedef struct http_head_s *http_head_t;
40    
41  class wHTTP {  class NetHTTP {
42  public:  public:
43      /* HTTP methods. */      /* HTTP methods. */
44      enum  { HTTP_GET, HTTP_HEAD, HTTP_PUT, HTTP_POST };      enum  { HTTP_GET, HTTP_HEAD, HTTP_PUT, HTTP_POST };
# Line 77  private: Line 71  private:
71      int sendRequest (const char *host, int port, const char *url);      int sendRequest (const char *host, int port, const char *url);
72    
73  public:  public:
74      wHTTP ();      NetHTTP ();
75      wHTTP (const char *url);      NetHTTP (const char *url);
76      wHTTP (const char *host, int port, const char *url);      NetHTTP (const char *host, int port, const char *url);
77      ~wHTTP ();      ~NetHTTP ();
78            
79      void setVersion (int ver);      void setVersion (int ver);
80      int getErrorCode (void);      int getErrorCode (void);
# Line 91  public: Line 85  public:
85      int addRequestHeader (const char *name, const char *val);      int addRequestHeader (const char *name, const char *val);
86      int addRequestHeader (const char *name, unsigned int val);      int addRequestHeader (const char *name, unsigned int val);
87            
88        int open (const char *url);
89      int write (const void *buf, unsigned int buflen);      int write (const void *buf, unsigned int buflen);
90      int read (void *buf, unsigned int buflen);      int read (void *buf, unsigned int buflen);
91      int readData (FILE *out);      int readData (FILE *out);

Legend:
Removed from v.200  
changed lines
  Added in v.312

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26