+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|a!/", &opts)) {
+ RETURN_FALSE;
+ }
+
+ MAKE_STD_ZVAL(new_opts);
+ array_init(new_opts);
+
+ if (!opts || !zend_hash_num_elements(Z_ARRVAL_P(opts))) {
+ zend_update_property(THIS_CE, getThis(), ZEND_STRS("options")-1, new_opts TSRMLS_CC);
+ zval_ptr_dtor(&new_opts);
+ RETURN_TRUE;
+ }
+
+ MAKE_STD_ZVAL(add_opts);
+ array_init(add_opts);
+ /* some options need extra attention -- thus cannot use array_merge() directly */
+ FOREACH_KEYVAL(pos, opts, key, opt) {
+ if (key.type == HASH_KEY_IS_STRING) {
+#define KEYMATCH(k, s) ((sizeof(s)==k.len) && !strcasecmp(k.str, s))
+ if (KEYMATCH(key, "headers")) {
+ zend_call_method_with_1_params(&getThis(), Z_OBJCE_P(getThis()), NULL, "addheaders", NULL, *opt);
+ } else if (KEYMATCH(key, "cookies")) {
+ zend_call_method_with_1_params(&getThis(), Z_OBJCE_P(getThis()), NULL, "addcookies", NULL, *opt);
+ } else if (KEYMATCH(key, "ssl")) {
+ zend_call_method_with_1_params(&getThis(), Z_OBJCE_P(getThis()), NULL, "addssloptions", NULL, *opt);
+ } else if (KEYMATCH(key, "url") || KEYMATCH(key, "uri")) {
+ zend_call_method_with_1_params(&getThis(), Z_OBJCE_P(getThis()), NULL, "seturl", NULL, *opt);
+ } else if (KEYMATCH(key, "method")) {
+ zend_call_method_with_1_params(&getThis(), Z_OBJCE_P(getThis()), NULL, "setmethod", NULL, *opt);
+ } else if (KEYMATCH(key, "flushcookies")) {
+ getObject(http_request_object, obj);
+ if (i_zend_is_true(*opt)) {
+ http_request_flush_cookies(obj->request);
+ }
+ } else if (KEYMATCH(key, "resetcookies")) {
+ getObject(http_request_object, obj);
+ http_request_reset_cookies(obj->request, (zend_bool) i_zend_is_true(*opt));
+ } else if (KEYMATCH(key, "enablecookies")) {
+ getObject(http_request_object, obj);
+ http_request_enable_cookies(obj->request);
+ } else if (KEYMATCH(key, "recordHistory")) {
+ zend_update_property(THIS_CE, getThis(), ZEND_STRS("recordHistory")-1, *opt TSRMLS_CC);
+ } else if (KEYMATCH(key, "messageClass")) {
+ zend_call_method_with_1_params(&getThis(), Z_OBJCE_P(getThis()), NULL, "setmessageclass", NULL, *opt);
+ } else if (Z_TYPE_PP(opt) == IS_NULL) {
+ old_opts = zend_read_property(THIS_CE, getThis(), ZEND_STRS("options")-1, 0 TSRMLS_CC);
+ if (Z_TYPE_P(old_opts) == IS_ARRAY) {
+ zend_hash_del(Z_ARRVAL_P(old_opts), key.str, key.len);
+ }
+ } else {
+ ZVAL_ADDREF(*opt);
+ add_assoc_zval_ex(add_opts, key.str, key.len, *opt);
+ }
+ }
+ }
+
+ old_opts = zend_read_property(THIS_CE, getThis(), ZEND_STRS("options")-1, 0 TSRMLS_CC);
+ if (Z_TYPE_P(old_opts) == IS_ARRAY) {
+ array_copy(Z_ARRVAL_P(old_opts), Z_ARRVAL_P(new_opts));
+ }
+ array_join(Z_ARRVAL_P(add_opts), Z_ARRVAL_P(new_opts), 0, 0);
+ zend_update_property(THIS_CE, getThis(), ZEND_STRS("options")-1, new_opts TSRMLS_CC);
+ zval_ptr_dtor(&new_opts);
+ zval_ptr_dtor(&add_opts);
+
+ RETURN_TRUE;
+}
+/* }}} */
+
+/* {{{ proto array HttpRequest::getOptions()
+ Get currently set options. */
+PHP_METHOD(HttpRequest, getOptions)
+{
+ NO_ARGS;
+
+ if (return_value_used) {
+ RETURN_PROP(options);
+ }
+}
+/* }}} */
+
+/* {{{ proto bool HttpRequest::setSslOptions([array options])
+ Set SSL options. */
+PHP_METHOD(HttpRequest, setSslOptions)
+{
+ http_request_object_set_options_subr("ssl", 1, 0);
+}
+/* }}} */
+
+/* {{{ proto bool HttpRequest::addSslOptions(array options)
+ Set additional SSL options. */
+PHP_METHOD(HttpRequest, addSslOptions)
+{
+ http_request_object_set_options_subr("ssl", 0, 0);
+}
+/* }}} */
+
+/* {{{ proto array HttpRequest::getSslOtpions()
+ Get previously set SSL options. */
+PHP_METHOD(HttpRequest, getSslOptions)
+{
+ http_request_object_get_options_subr("ssl");
+}
+/* }}} */
+
+/* {{{ proto bool HttpRequest::addHeaders(array headers)
+ Add request header name/value pairs. */
+PHP_METHOD(HttpRequest, addHeaders)
+{
+ http_request_object_set_options_subr("headers", 0, 1);
+}
+
+/* {{{ proto bool HttpRequest::setHeaders([array headers])
+ Set request header name/value pairs. */
+PHP_METHOD(HttpRequest, setHeaders)
+{
+ http_request_object_set_options_subr("headers", 1, 1);
+}
+/* }}} */
+
+/* {{{ proto array HttpRequest::getHeaders()
+ Get previously set request headers. */
+PHP_METHOD(HttpRequest, getHeaders)
+{
+ http_request_object_get_options_subr("headers");
+}
+/* }}} */
+
+/* {{{ proto bool HttpRequest::setCookies([array cookies])
+ Set cookies. */
+PHP_METHOD(HttpRequest, setCookies)
+{
+ http_request_object_set_options_subr("cookies", 1, 0);
+}
+/* }}} */
+
+/* {{{ proto bool HttpRequest::addCookies(array cookies)
+ Add cookies. */
+PHP_METHOD(HttpRequest, addCookies)
+{
+ http_request_object_set_options_subr("cookies", 0, 0);
+}
+/* }}} */
+
+/* {{{ proto array HttpRequest::getCookies()
+ Get previously set cookies. */
+PHP_METHOD(HttpRequest, getCookies)
+{
+ http_request_object_get_options_subr("cookies");
+}
+/* }}} */
+
+/* {{{ proto bool HttpRequest::enableCookies()
+ Enable automatic sending of received cookies. Note that customly set cookies will be sent anyway. */
+PHP_METHOD(HttpRequest, enableCookies)
+{
+ NO_ARGS {
+ getObject(http_request_object, obj);
+ RETURN_SUCCESS(http_request_enable_cookies(obj->request));
+ }
+
+}
+/* }}} */
+
+/* {{{ proto bool HttpRequest::resetCookies([bool session_only = FALSE])
+ Reset all automatically received/sent cookies. Note that customly set cookies are not affected. */
+PHP_METHOD(HttpRequest, resetCookies)
+{
+ zend_bool session_only = 0;
+ getObject(http_request_object, obj);
+
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &session_only)) {
+ RETURN_FALSE;
+ }
+ RETURN_SUCCESS(http_request_reset_cookies(obj->request, session_only));
+}
+/* }}} */
+
+/* {{{ proto bool HttpRequest::flushCookies()
+ Flush internal cookies to the cookiestore file */
+PHP_METHOD(HttpRequest, flushCookies)
+{
+ NO_ARGS {
+ getObject(http_request_object, obj);
+ RETURN_SUCCESS(http_request_flush_cookies(obj->request));
+ }
+}
+/* }}} */
+
+/* {{{ proto bool HttpRequest::setUrl(string url)
+ Set the request URL. */
+PHP_METHOD(HttpRequest, setUrl)
+{
+ char *URL = NULL;
+ int URL_len;
+
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &URL, &URL_len)) {
+ RETURN_FALSE;
+ }
+
+ zend_update_property_stringl(THIS_CE, getThis(), ZEND_STRS("url")-1, URL, URL_len TSRMLS_CC);
+ RETURN_TRUE;
+}
+/* }}} */
+
+/* {{{ proto string HttpRequest::getUrl()
+ Get the previously set request URL. */
+PHP_METHOD(HttpRequest, getUrl)
+{
+ NO_ARGS;
+
+ if (return_value_used) {
+ RETURN_PROP(url);
+ }
+}
+/* }}} */
+
+/* {{{ proto bool HttpRequest::setMethod(int request_method)
+ Set the request method. */
+PHP_METHOD(HttpRequest, setMethod)
+{
+ long meth;
+
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &meth)) {
+ RETURN_FALSE;
+ }
+
+ zend_update_property_long(THIS_CE, getThis(), ZEND_STRS("method")-1, meth TSRMLS_CC);
+ RETURN_TRUE;
+}
+/* }}} */
+
+/* {{{ proto int HttpRequest::getMethod()
+ Get the previously set request method. */
+PHP_METHOD(HttpRequest, getMethod)
+{
+ NO_ARGS;
+
+ if (return_value_used) {
+ RETURN_PROP(method);
+ }
+}
+/* }}} */
+
+/* {{{ proto bool HttpRequest::setContentType(string content_type)
+ Set the content type the post request should have. */
+PHP_METHOD(HttpRequest, setContentType)
+{
+ char *ctype;
+ int ct_len;
+
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &ctype, &ct_len)) {
+ RETURN_FALSE;
+ }
+
+ if (ct_len) {
+ HTTP_CHECK_CONTENT_TYPE(ctype, RETURN_FALSE);
+ }
+ zend_update_property_stringl(THIS_CE, getThis(), ZEND_STRS("contentType")-1, ctype, ct_len TSRMLS_CC);
+ RETURN_TRUE;
+}
+/* }}} */
+
+/* {{{ proto string HttpRequest::getContentType()
+ Get the previously content type. */
+PHP_METHOD(HttpRequest, getContentType)
+{
+ NO_ARGS;
+
+ if (return_value_used) {
+ RETURN_PROP(contentType);
+ }
+}
+/* }}} */
+
+/* {{{ proto bool HttpRequest::setQueryData([mixed query_data])
+ Set the URL query parameters to use, overwriting previously set query parameters. */
+PHP_METHOD(HttpRequest, setQueryData)
+{
+ zval *qdata = NULL;
+
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z!", &qdata)) {
+ RETURN_FALSE;
+ }
+
+ if ((!qdata) || Z_TYPE_P(qdata) == IS_NULL) {
+ zend_update_property_stringl(THIS_CE, getThis(), ZEND_STRS("queryData")-1, "", 0 TSRMLS_CC);
+ } else if ((Z_TYPE_P(qdata) == IS_ARRAY) || (Z_TYPE_P(qdata) == IS_OBJECT)) {
+ char *query_data = NULL;
+
+ if (SUCCESS != http_urlencode_hash(HASH_OF(qdata), &query_data)) {
+ RETURN_FALSE;
+ }
+
+ zend_update_property_string(THIS_CE, getThis(), ZEND_STRS("queryData")-1, query_data TSRMLS_CC);
+ efree(query_data);
+ } else {
+ zval *data = http_zsep(IS_STRING, qdata);
+
+ zend_update_property_stringl(THIS_CE, getThis(), ZEND_STRS("queryData")-1, Z_STRVAL_P(data), Z_STRLEN_P(data) TSRMLS_CC);
+ zval_ptr_dtor(&data);
+ }
+ RETURN_TRUE;
+}
+/* }}} */
+
+/* {{{ proto string HttpRequest::getQueryData()
+ Get the current query data in form of an urlencoded query string. */
+PHP_METHOD(HttpRequest, getQueryData)
+{
+ NO_ARGS;
+
+ if (return_value_used) {
+ RETURN_PROP(queryData);
+ }
+}
+/* }}} */
+
+/* {{{ proto bool HttpRequest::addQueryData(array query_params)
+ Add parameters to the query parameter list, leaving previously set unchanged. */
+PHP_METHOD(HttpRequest, addQueryData)
+{
+ zval *qdata, *old_qdata;
+ char *query_data = NULL;
+ size_t query_data_len = 0;
+
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/", &qdata)) {
+ RETURN_FALSE;
+ }
+
+ old_qdata = zend_read_property(THIS_CE, getThis(), ZEND_STRS("queryData")-1, 0 TSRMLS_CC);
+
+ if (SUCCESS != http_urlencode_hash_ex(HASH_OF(qdata), 1, Z_STRVAL_P(old_qdata), Z_STRLEN_P(old_qdata), &query_data, &query_data_len)) {
+ RETURN_FALSE;
+ }
+
+ zend_update_property_stringl(THIS_CE, getThis(), ZEND_STRS("queryData")-1, query_data, query_data_len TSRMLS_CC);
+ efree(query_data);
+
+ RETURN_TRUE;
+}
+/* }}} */
+
+/* {{{ proto bool HttpRequest::addPostFields(array post_data)
+ Adds POST data entries, leaving previously set unchanged, unless a post entry with the same name already exists. */
+PHP_METHOD(HttpRequest, addPostFields)
+{
+ zval *post_data, *old_post, *new_post;
+
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/", &post_data)) {
+ RETURN_FALSE;
+ }
+
+ if (zend_hash_num_elements(Z_ARRVAL_P(post_data))) {
+ MAKE_STD_ZVAL(new_post);
+ array_init(new_post);
+ old_post = zend_read_property(THIS_CE, getThis(), ZEND_STRS("postFields")-1, 0 TSRMLS_CC);
+ if (Z_TYPE_P(old_post) == IS_ARRAY) {
+ array_copy(Z_ARRVAL_P(old_post), Z_ARRVAL_P(new_post));
+ }
+ array_join(Z_ARRVAL_P(post_data), Z_ARRVAL_P(new_post), 0, 0);
+ zend_update_property(THIS_CE, getThis(), ZEND_STRS("postFields")-1, new_post TSRMLS_CC);
+ zval_ptr_dtor(&new_post);
+ }
+
+ RETURN_TRUE;
+}
+/* }}} */
+
+/* {{{ proto bool HttpRequest::setPostFields([array post_data])
+ Set the POST data entries, overwriting previously set POST data. */
+PHP_METHOD(HttpRequest, setPostFields)
+{
+ zval *post, *post_data = NULL;
+
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/!", &post_data)) {
+ RETURN_FALSE;
+ }
+
+ MAKE_STD_ZVAL(post);
+ array_init(post);
+ if (post_data && zend_hash_num_elements(Z_ARRVAL_P(post_data))) {
+ array_copy(Z_ARRVAL_P(post_data), Z_ARRVAL_P(post));
+ }
+ zend_update_property(THIS_CE, getThis(), ZEND_STRS("postFields")-1, post TSRMLS_CC);
+ zval_ptr_dtor(&post);
+
+ RETURN_TRUE;
+}
+/* }}}*/
+
+/* {{{ proto array HttpRequest::getPostFields()
+ Get previously set POST data. */
+PHP_METHOD(HttpRequest, getPostFields)
+{
+ NO_ARGS;
+
+ if (return_value_used) {
+ RETURN_PROP(postFields);
+ }
+}
+/* }}} */
+
+/* {{{ proto bool HttpRequest::setBody([string request_body_data])
+ Set request body to send, overwriting previously set request body. Don't forget to specify a content type. */
+PHP_METHOD(HttpRequest, setBody)
+{
+ char *raw_data = NULL;
+ int data_len = 0;
+
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &raw_data, &data_len)) {
+ RETURN_FALSE;
+ }
+
+ if (!raw_data) {
+ raw_data = "";
+ }
+
+ zend_update_property_stringl(THIS_CE, getThis(), ZEND_STRS("requestBody")-1, raw_data, data_len TSRMLS_CC);
+ RETURN_TRUE;
+}
+/* }}} */
+
+/* {{{ proto bool HttpRequest::addBody(string request_body_data)
+ Add request body data, leaving previously set request body data unchanged. */
+PHP_METHOD(HttpRequest, addBody)
+{
+ char *raw_data;
+ int data_len;
+
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &raw_data, &data_len)) {
+ RETURN_FALSE;
+ }
+
+ if (data_len) {
+ zval *data = zend_read_property(THIS_CE, getThis(), ZEND_STRS("requestBody")-1, 0 TSRMLS_CC);
+
+ if (Z_STRLEN_P(data)) {
+ Z_STRVAL_P(data) = erealloc(Z_STRVAL_P(data), (Z_STRLEN_P(data) += data_len) + 1);
+ Z_STRVAL_P(data)[Z_STRLEN_P(data)] = '\0';
+ memcpy(Z_STRVAL_P(data) + Z_STRLEN_P(data) - data_len, raw_data, data_len);
+ } else {
+ zend_update_property_stringl(THIS_CE, getThis(), ZEND_STRS("requestBody")-1, raw_data, data_len TSRMLS_CC);
+ }
+ }
+
+ RETURN_TRUE;
+}
+/* }}} */
+
+/* {{{ proto string HttpRequest::getBody()
+ Get previously set request body data. */
+PHP_METHOD(HttpRequest, getBody)
+{
+ NO_ARGS;
+
+ if (return_value_used) {
+ RETURN_PROP(requestBody);
+ }
+}
+/* }}} */
+
+/* {{{ proto bool HttpRequest::addPostFile(string name, string file[, string content_type = "application/x-octetstream"])
+ Add a file to the POST request, leaving previously set files unchanged. */
+PHP_METHOD(HttpRequest, addPostFile)
+{
+ zval *entry, *old_post, *new_post;
+ char *name, *file, *type = NULL;
+ int name_len, file_len, type_len = 0;
+
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|s", &name, &name_len, &file, &file_len, &type, &type_len)) {
+ RETURN_FALSE;
+ }
+
+ if (type_len) {
+ HTTP_CHECK_CONTENT_TYPE(type, RETURN_FALSE);
+ } else {
+ type = "application/x-octetstream";
+ type_len = sizeof("application/x-octetstream") - 1;
+ }
+
+ MAKE_STD_ZVAL(entry);
+ array_init(entry);
+
+ add_assoc_stringl(entry, "name", name, name_len, 1);
+ add_assoc_stringl(entry, "type", type, type_len, 1);
+ add_assoc_stringl(entry, "file", file, file_len, 1);
+
+ MAKE_STD_ZVAL(new_post);
+ array_init(new_post);
+ old_post = zend_read_property(THIS_CE, getThis(), ZEND_STRS("postFiles")-1, 0 TSRMLS_CC);
+ if (Z_TYPE_P(old_post) == IS_ARRAY) {
+ array_copy(Z_ARRVAL_P(old_post), Z_ARRVAL_P(new_post));
+ }
+ add_next_index_zval(new_post, entry);
+ zend_update_property(THIS_CE, getThis(), ZEND_STRS("postFiles")-1, new_post TSRMLS_CC);
+ zval_ptr_dtor(&new_post);
+
+ RETURN_TRUE;
+}
+/* }}} */
+
+/* {{{ proto bool HttpRequest::setPostFiles([array post_files])
+ Set files to post, overwriting previously set post files. */
+PHP_METHOD(HttpRequest, setPostFiles)
+{
+ zval *files = NULL, *post;
+
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a!/", &files)) {
+ RETURN_FALSE;
+ }
+
+ MAKE_STD_ZVAL(post);
+ array_init(post);
+ if (files && (Z_TYPE_P(files) == IS_ARRAY)) {
+ array_copy(Z_ARRVAL_P(files), Z_ARRVAL_P(post));
+ }
+ zend_update_property(THIS_CE, getThis(), ZEND_STRS("postFiles")-1, post TSRMLS_CC);
+ zval_ptr_dtor(&post);
+
+ RETURN_TRUE;
+}
+/* }}} */
+
+/* {{{ proto array HttpRequest::getPostFiles()
+ Get all previously added POST files. */
+PHP_METHOD(HttpRequest, getPostFiles)
+{
+ NO_ARGS;
+
+ if (return_value_used) {
+ RETURN_PROP(postFiles);
+ }
+}
+/* }}} */
+
+/* {{{ proto bool HttpRequest::setPutFile([string file])
+ Set file to put. Affects only PUT requests. */
+PHP_METHOD(HttpRequest, setPutFile)
+{
+ char *file = "";
+ int file_len = 0;
+
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &file, &file_len)) {
+ RETURN_FALSE;
+ }
+
+ zend_update_property_stringl(THIS_CE, getThis(), ZEND_STRS("putFile")-1, file, file_len TSRMLS_CC);
+ RETURN_TRUE;
+}
+/* }}} */
+
+/* {{{ proto string HttpRequest::getPutFile()
+ Get previously set put file. */
+PHP_METHOD(HttpRequest, getPutFile)
+{
+ NO_ARGS;
+
+ if (return_value_used) {
+ RETURN_PROP(putFile);
+ }
+}
+/* }}} */
+
+/* {{{ proto bool HttpRequest::setPutData([string put_data])
+ Set PUT data to send, overwriting previously set PUT data. */
+PHP_METHOD(HttpRequest, setPutData)
+{
+ char *put_data = NULL;
+ int data_len = 0;
+
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &put_data, &data_len)) {
+ RETURN_FALSE;
+ }
+
+ if (!put_data) {
+ put_data = "";
+ }
+
+ zend_update_property_stringl(THIS_CE, getThis(), ZEND_STRS("putData")-1, put_data, data_len TSRMLS_CC);
+ RETURN_TRUE;
+}
+/* }}} */
+
+/* {{{ proto bool HttpRequest::addPutData(string put_data)
+ Add PUT data, leaving previously set PUT data unchanged. */
+PHP_METHOD(HttpRequest, addPutData)
+{
+ char *put_data;
+ int data_len;
+
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &put_data, &data_len)) {
+ RETURN_FALSE;
+ }
+
+ if (data_len) {
+ zval *data = zend_read_property(THIS_CE, getThis(), ZEND_STRS("putData")-1, 0 TSRMLS_CC);
+
+ if (Z_STRLEN_P(data)) {
+ Z_STRVAL_P(data) = erealloc(Z_STRVAL_P(data), (Z_STRLEN_P(data) += data_len) + 1);
+ Z_STRVAL_P(data)[Z_STRLEN_P(data)] = '\0';
+ memcpy(Z_STRVAL_P(data) + Z_STRLEN_P(data) - data_len, put_data, data_len);
+ } else {
+ zend_update_property_stringl(THIS_CE, getThis(), ZEND_STRS("putData")-1, put_data, data_len TSRMLS_CC);
+ }
+ }
+
+ RETURN_TRUE;
+}
+/* }}} */
+
+/* {{{ proto string HttpRequest::getPutData()
+ Get previously set PUT data. */
+PHP_METHOD(HttpRequest, getPutData)
+{
+ NO_ARGS;
+
+ if (return_value_used) {
+ RETURN_PROP(putData);
+ }
+}
+/* }}} */
+
+/* {{{ proto array HttpRequest::getResponseData()
+ Get all response data after the request has been sent. */
+PHP_METHOD(HttpRequest, getResponseData)
+{
+ NO_ARGS;
+
+ if (return_value_used) {