if (SUCCESS == http_get(URL, options ? Z_ARRVAL_P(options) : NULL, info ? Z_ARRVAL_P(info) : NULL, &response)) {
RETURN_PHPSTR_VAL(&response);
} else {
+ phpstr_dtor(&response);
RETURN_FALSE;
}
}
if (SUCCESS == http_head(URL, options ? Z_ARRVAL_P(options) : NULL, info ? Z_ARRVAL_P(info) : NULL, &response)) {
RETURN_PHPSTR_VAL(&response);
} else {
+ phpstr_dtor(&response);
RETURN_FALSE;
}
}
if (SUCCESS == http_post(URL, &body, options ? Z_ARRVAL_P(options) : NULL, info ? Z_ARRVAL_P(info) : NULL, &response)) {
RETVAL_PHPSTR_VAL(&response);
} else {
+ phpstr_dtor(&response);
RETVAL_FALSE;
}
}
if (SUCCESS == http_post(URL, &body, options ? Z_ARRVAL_P(options) : NULL, info ? Z_ARRVAL_P(info) : NULL, &response)) {
RETVAL_PHPSTR_VAL(&response);
} else {
+ phpstr_dtor(&response);
RETVAL_FALSE;
}
http_request_body_dtor(&body);
if (SUCCESS == http_put(URL, &body, options ? Z_ARRVAL_P(options) : NULL, info ? Z_ARRVAL_P(info) : NULL, &response)) {
RETVAL_PHPSTR_VAL(&response);
} else {
+ phpstr_dtor(&response);
RETVAL_FALSE;
}
http_request_body_dtor(&body);
if (SUCCESS == http_put(URL, &body, options ? Z_ARRVAL_P(options) : NULL, info ? Z_ARRVAL_P(info) : NULL, &response)) {
RETURN_PHPSTR_VAL(&response);
} else {
+ phpstr_dtor(&response);
RETURN_NULL();
}
}
}
#endif
- /* compress, empty string enables deflate and gzip */
+ /* compress, empty string enables all supported if libcurl was build with zlib support */
if ((zoption = http_curl_getopt(options, "compress", IS_BOOL)) && Z_LVAL_P(zoption)) {
+#ifdef HTTP_HAVE_ZLIB
+ HTTP_CURL_OPT(ENCODING, "gzip;q=1.0, deflate;q=0.5, *;q=0");
+#else
HTTP_CURL_OPT(ENCODING, "");
+#endif
}
/* redirects, defaults to 0 */