foobar2000 SDK  2015-08-03
http_client.h
Go to the documentation of this file.
1 class NOVTABLE http_reply : public service_base {
4  FB2K_MAKE_SERVICE_INTERFACE(http_reply, service_base)
5 public:
7  virtual void get_status(pfc::string_base & out) = 0;
9  virtual bool get_http_header(const char * name, pfc::string_base & out) = 0;
11  virtual bool get_http_header_multi(const char * name, pfc::string_base & out) = 0;
12 };
13 
14 class NOVTABLE http_request : public service_base {
15  FB2K_MAKE_SERVICE_INTERFACE(http_request, service_base)
16 public:
19  virtual void add_header(const char * line) = 0;
21  virtual file::ptr run(const char * url, abort_callback & abort) = 0;
23  virtual file::ptr run_ex(const char * url, abort_callback & abort) = 0;
24 
25  void add_header(const char * name, const char * value) {
26  add_header(PFC_string_formatter() << name << ": " << value);
27  }
28 };
29 
30 class NOVTABLE http_request_post : public http_request {
31  FB2K_MAKE_SERVICE_INTERFACE(http_request_post, http_request);
32 public:
37  virtual void add_post_data(const char * name, const void * data, t_size dataSize, const char * fileName, const char * contentType) = 0;
38 
39  void add_post_data(const char * name, const char * value) { add_post_data(name, value, strlen(value), "", ""); }
40 };
41 
42 class NOVTABLE http_client : public service_base {
43  FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT(http_client)
44 public:
47  virtual http_request::ptr create_request(const char * type) = 0;
48 };
Implemented by file object returned by http_request::run methods. Allows you to retrieve various addi...
Definition: http_client.h:3
size_t t_size
Definition: int_types.h:48
void add_post_data(const char *name, const char *value)
Definition: http_client.h:39
Base class for all service classes. Provides interfaces for reference counter and querying for differ...
Definition: service.h:333
void add_header(const char *name, const char *value)
Definition: http_client.h:25
Definition: http_client.h:30