| verzia 1.3, 2001/10/25 20:05:28 |
verzia 1.4, 2001/10/30 17:24:02 |
|
|
| /* |
/* |
| * Author: Lubomir Host 'rajo' <host8@kepler.fmph.uniba.sk> |
* Author: Lubomir Host 'rajo' <host8@kepler.fmph.uniba.sk> |
| * $Log$ |
* $Log$ |
| |
* Revision 1.4 2001/10/30 17:24:02 host8 |
| |
* New implementation of http request. |
| |
* |
| * Revision 1.3 2001/10/25 20:05:28 host8 |
* Revision 1.3 2001/10/25 20:05:28 host8 |
| * First implementation of login with password. |
* First implementation of login with password. |
| * |
* |
|
|
| #ifndef _HTTP_H |
#ifndef _HTTP_H |
| #define _HTTP_H |
#define _HTTP_H |
| |
|
| |
/* |
| |
#define USER_AGENT "User-Agent: Lynx/2.8.4dev.7 libwww-FM/2.14\r\n" |
| |
"User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; DigExt)\r\n" |
| |
*/ |
| |
#define USER_AGENT "User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Linux) Opera 5.0 [en]\r\n" |
| |
|
| |
#define HTTP_GET 0 |
| |
#define HTTP_POST 1 |
| |
|
| |
/* |
| |
typedef struct WWW_STRUCT { |
| |
int method; |
| |
char *host; |
| |
char *referer; |
| |
char *cookies; |
| |
char *user_agent; |
| |
} WWW; |
| |
|
| |
extern WWW www; |
| |
*/ |
| |
|
| |
typedef struct HTTP_REQUEST_STRUCT { |
| |
FILE *frw; |
| |
int method; |
| |
int port; |
| |
char *ret_val; |
| |
char *host; |
| |
char *file; |
| |
char *cookies; |
| |
} HTTP_REQUEST; |
| |
|
| |
extern HTTP_REQUEST **requests; |
| |
|
| extern void http_set_cookie(char *str); |
extern int http_request_by_request(HTTP_REQUEST *r); |
| extern void http_set_referer(char *host, char *file); |
|
| extern FILE *http_connect(void); |
|
| extern void http_read_source(FILE *f, char *host, char *file); |
|
| extern int http_request(int method, char *file, char *host, char *fmt, ...); |
extern int http_request(int method, char *file, char *host, char *fmt, ...); |
| |
extern void http_init(void); |
| |
|
| #endif /* #ifndef _HTTP_H */ |
#endif /* #ifndef _HTTP_H */ |
| |
|