2 #include "../acl_cpp_define.hpp" 4 #include "../stdlib/string.hpp" 5 #include "../stdlib/noncopyable.hpp" 6 #include "../http/http_header.hpp" 10 #ifndef ACL_CLIENT_ONLY 25 class HttpServletResponse;
47 int body_limit = 102400);
61 const std::vector<HttpCookie*>& getCookies(
void)
const;
69 const char* getCookieValue(
const char*
name)
const;
76 void setCookie(
const char*
name,
const char* value);
84 const char* getHeader(
const char*
name)
const;
91 const char* getQueryString(
void)
const;
98 const char* getPathInfo(
void)
const;
105 const char* getRequestUri(
void)
const;
118 HttpSession& getSession(
bool create =
true,
const char* sid = NULL);
124 istream& getInputStream(
void)
const;
137 #if defined(_WIN32) || defined(_WIN64) 138 __int64 getContentLength(
void)
const;
140 long long int getContentLength(
void)
const;
151 #if defined(_WIN32) || defined(_WIN64) 152 bool getRange(__int64& range_from, __int64& range_to);
154 bool getRange(
long long int& range_from,
long long int& range_to);
164 const char* getContentType(
165 bool part =
true,
http_ctype* ctype = NULL)
const;
173 const char* getCharacterEncoding(
void)
const;
179 const char* getLocalCharset(
void)
const;
185 const char* getLocalAddr(
void)
const;
191 unsigned short getLocalPort(
void)
const;
197 const char* getRemoteAddr(
void)
const;
203 unsigned short getRemotePort(
void)
const;
209 const char* getRemoteHost(
void)
const;
215 const char* getUserAgent(
void)
const;
226 const char* getParameter(
const char*
name,
227 bool case_sensitive =
false)
const;
250 json* getJson(
size_t body_limit = 1024000);
262 bool getJson(
json& out,
size_t body_limit = 1024000);
274 xml* getXml(
size_t body_limit = 1024000);
286 bool getXml(
xml& out,
size_t body_limit = 1024000);
298 string* getBody(
size_t body_limit = 1024000);
309 bool getBody(
string& out,
size_t body_limit = 1024000);
323 const char* getRequestReferer(
void)
const;
335 bool isKeepAlive(
void)
const;
341 int getKeepAlive(
void)
const;
349 bool getVersion(
unsigned& major,
unsigned& minor)
const;
355 void getAcceptEncoding(std::vector<string>& out)
const;
362 void setRwTimeout(
int rw_timeout);
383 void fprint_header(
ostream& out,
const char* prompt);
390 void sprint_header(
string& out,
const char* prompt);
396 char cookie_name_[64];
404 std::vector<HttpCookie*> cookies_;
405 bool cookies_inited_;
411 char remoteAddr_[32];
412 char localCharset_[32];
414 std::vector<HTTP_PARAM*> params_;
421 bool readHeaderCalled_;
422 bool readHeader(
string* method_s);
424 void add_cookie(
char* data);
425 void parseParameters(
const char* str);
430 #endif // ACL_CLIENT_ONLY
HTTP_API void const char * name