diff options
Diffstat (limited to 'protocols/FacebookRM/src/http_request.h')
-rw-r--r-- | protocols/FacebookRM/src/http_request.h | 75 |
1 files changed, 10 insertions, 65 deletions
diff --git a/protocols/FacebookRM/src/http_request.h b/protocols/FacebookRM/src/http_request.h index ffdb6d40ce..df79b87b68 100644 --- a/protocols/FacebookRM/src/http_request.h +++ b/protocols/FacebookRM/src/http_request.h @@ -48,36 +48,11 @@ protected: HttpRequestUrl& operator=(const HttpRequestUrl&); // to prevent copying; public: - HttpRequestUrl& operator<<(const char *param) - { - if (param) - request.AddUrlParameter("%s", param); - return *this; - } - - HttpRequestUrl& operator<<(const BOOL_PARAM ¶m) - { - request.AddUrlParameter("%s=%s", param.szName, param.bValue ? "true" : "false"); - return *this; - } - - HttpRequestUrl& operator<<(const INT_PARAM ¶m) - { - request.AddUrlParameter("%s=%i", param.szName, param.iValue); - return *this; - } - - HttpRequestUrl& operator<<(const INT64_PARAM ¶m) - { - request.AddUrlParameter("%s=%lld", param.szName, param.iValue); - return *this; - } - - HttpRequestUrl& operator<<(const CHAR_PARAM ¶m) - { - request.AddUrlParameter("%s=%s", param.szName, param.szValue); - return *this; - } + HttpRequestUrl& operator<<(const char *param); + HttpRequestUrl& operator<<(const BOOL_PARAM ¶m); + HttpRequestUrl& operator<<(const INT_PARAM ¶m); + HttpRequestUrl& operator<<(const INT64_PARAM ¶m); + HttpRequestUrl& operator<<(const CHAR_PARAM ¶m); char* ToString() { @@ -129,41 +104,11 @@ protected: public: HttpRequestBody() {} - HttpRequestBody& operator<<(const char *str) - { - AppendSeparator(); - if (str != nullptr) - content.Append(str); - return *this; - } - - HttpRequestBody& operator<<(const BOOL_PARAM ¶m) - { - AppendSeparator(); - content.AppendFormat("%s=%s", param.szName, param.bValue ? "true" : "false"); - return *this; - } - - HttpRequestBody& operator<<(const INT_PARAM ¶m) - { - AppendSeparator(); - content.AppendFormat("%s=%i", param.szName, param.iValue); - return *this; - } - - HttpRequestBody& operator<<(const INT64_PARAM ¶m) - { - AppendSeparator(); - content.AppendFormat("%s=%lld", param.szName, param.iValue); - return *this; - } - - HttpRequestBody& operator<<(const CHAR_PARAM ¶m) - { - AppendSeparator(); - content.AppendFormat("%s=%s", param.szName, utils::url::encode(param.szValue).c_str()); - return *this; - } + HttpRequestBody& operator<<(const char *str); + HttpRequestBody& operator<<(const BOOL_PARAM ¶m); + HttpRequestBody& operator<<(const INT_PARAM ¶m); + HttpRequestBody& operator<<(const INT64_PARAM ¶m); + HttpRequestBody& operator<<(const CHAR_PARAM ¶m); char* ToString() { |